locked
Metro Javascript HTML app connect to SOAP service

    Question

  • Hi all,

    I need to consume Axis2 SOAP services from my Metro App - using HTML / JavaScript.

    I am already consuming RESTful services with WinJS.Xhr, but I cannot find instructions on how to consume SOAP services.

    Are there any helper libraries to create SOAP evenlope, header and body? Or helper libraries to construct the XML request? Anything to create helper classes based upon a given WSDL?

    I believe this would be helpful to many other developers.

    Thanks

    Thomas

    Thursday, April 11, 2013 8:05 AM

Answers

  • Hi Thomas,

    Unfortunately that IS the answer!  If you want to consume a pure SOAP interface you can certainly do that but it is extremely cumbersome.

    A SOAP call is simply an HTTP(S) call that has an envelope and headers that your service expects (here is the RFC: http://www.w3.org/TR/2003/REC-soap12-part1-20030624/).

    You have to manually create the SOAP envelope and message and decode it manually as well.  There are a bunch of examples of how to go after SOAP endpoints using xhr in JavaScript if you Bing it, but bottom line... You have to build the request yourself.  There are some 3rd party libraries as well but I cannot recommend one over the other.

    Do you have an example of a public SOAP service you are attempting to communicate with?

    -Jeff


    Jeff Sanders (MSFT)

    Thursday, April 11, 2013 8:29 PM
    Moderator

All replies