Answered by:
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)
- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Thursday, April 11, 2013 8:29 PM
- Marked as answer by Song Tian Thursday, April 18, 2013 8:55 AM
Thursday, April 11, 2013 8:29 PMModerator
All replies
-
Hi Thomas,
Forum search is your friend!
Jeff Sanders (MSFT)
- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Thursday, April 11, 2013 1:35 PM
Thursday, April 11, 2013 1:35 PMModerator -
Hi Jeff,
in this case search is not my friend. I binged and googled for sample material, and had a good look into the search link you just sent me, but there are only answers in the style of "use REST", "use JSON-reply based Services", but nothing good on really consuming SOAP Services exposed by non-Microsoft but Standard J2EE implementations.
I therefore believe it would be really useful to a great number of people to see this question answered.
Thanks a lot
Thomas
Thursday, April 11, 2013 8:11 PM -
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)
- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Thursday, April 11, 2013 8:29 PM
- Marked as answer by Song Tian Thursday, April 18, 2013 8:55 AM
Thursday, April 11, 2013 8:29 PMModerator