English 中文(简体)
SOAP in WinRT (Windows 8 Metro App)
原标题:

I want to use a SOAP web service in a Metro App, using WinJS. What is the best way to do it?

最佳回答

You will need to use the WinJS.xhr object to make the call to your SOAP webservice. Your not mentioning that many details about the soap request you want to make, so i created a little dummy code which you need to fill in with your own paramters:

WinJS.xhr({
  type: "GET", 
  user: accountSid, 
  password: authKey, 
  url: "http://yourWebserviceUrl.com",
  headers: { "YourSoapHeaders": "WithTheirValues" },
    }).then(success, error);

function succes(response)
{
}

function error(error)
{
}

Please note that only the url property in the xhr request is mandatory. If you don t have a username/password you can just remove these values from the object. Additional if you need to send data with your request (for example if you do a POST request) than you can use the data property to enter that data.

Additional here s a post on MSDN about consuming a webservice with WinJS.Xhr http://msdn.microsoft.com/en-us/library/windows/apps/hh868282.aspx

(Please note that this is not a SOAP webservice, but they explain the concept of consuming webservices)

问题回答

暂无回答




相关问题
Python SOAP server / client

I have a problem with Python and SOAP. I need to create a web service based on SOAP in Python. I read that I can use libraries like soaplib, suds and ZSI. I created a Hello World web service with ...

HTTP POST and complex structures

I m trying to send a complex HTTP POST request to a web service. The web service was created using VS2008, in which you can set VS to create HTTP POST and GET interfaces alongside the SOAP one. Now ...

XML-RPC Standard and XML Data Type

I was looking at XML-RPC for a project. And correct me if I m wrong, but it seems like XML-RPC has no XML datatype. Are you supposed to pass as a string? or something else? Am I missing something? ...

Most appropriate API for URL shortening service

I ve just finished an online service for shortening URLs (in php5 with Zend Framework); you can enter an URL and you get an short URL (like tinyurl and such sites). I m thinking about the API for ...

What is the best solution for creating a SOAP Server in PHP?

I need some advice on which library is the best choice when it comes to creating SOAP servers (and eventually SOAP clients) in PHP. I know there is built-in functions for this, but is that really the ...

Logging all Soap request and responses in PHP

Does anyone know how to log all request and responses with the builtin SoapClient in PHP? I could in fact manually log everything with SoapClient::__getLastRequest() and SoapClient::__getLastResponse()...

热门标签