You need to sign in to do that
Don't have an account?
aezell
Dealing with XML returned from Web Service
The new callout functionality is really great. However, there seems to be a rather gaping hole.
Many web services return XML in their responses, yet, Apex seems to have no way to deal with this XML. There seems to be no variable type in which to store the XML and no methods for parsing that XML.
I must be missing something. My use case here is a callout to the Zipcode Info service at webservicex.net. It returns XML which contains information about that zipcode, including city and state.
I've generated the Apex class from the WSDL and it's compiled fine. What I can't seem to do is write any code that will compile because the return value from the class calling the service is always expected to be XML.
The WSDL location is here: http://www.webservicex.net/uszip.asmx?wsdl
I edited it to use only the SOAP ports and bindings. Would I be better off using one of the other bindings/ports?
Essentially, I'm just lost here finding out any details on consuming a third-party web service past the basic, and seemingly incomplete, examples in the Apex Language Reference.
Thanks for reading all that!
Many web services return XML in their responses, yet, Apex seems to have no way to deal with this XML. There seems to be no variable type in which to store the XML and no methods for parsing that XML.
I must be missing something. My use case here is a callout to the Zipcode Info service at webservicex.net. It returns XML which contains information about that zipcode, including city and state.
I've generated the Apex class from the WSDL and it's compiled fine. What I can't seem to do is write any code that will compile because the return value from the class calling the service is always expected to be XML.
The WSDL location is here: http://www.webservicex.net/uszip.asmx?wsdl
I edited it to use only the SOAP ports and bindings. Would I be better off using one of the other bindings/ports?
Essentially, I'm just lost here finding out any details on consuming a third-party web service past the basic, and seemingly incomplete, examples in the Apex Language Reference.
Thanks for reading all that!
support xsd:any yet.
Next release we are planning to support HTTP callout and an XML parser
in Apex. I think this will solve your problem.
Thanks,
Is there any support in Apex for REST-based web services?
With HTTP callout you can callout to any http server
(including rest endpoints).
What's the difference between HTTP Callouts and Webservice Callouts?
Any chance you could point me to some documentation on that? I don't see it mentioned in the language reference or the cookbook.
These HTTP Callouts are available within an Apex class, right? What about inside an Apex trigger?
Like I said, if this is all documented somewhere, please point me that way. :)
2. HTTP callout is not released (GA) yet.