You should strive to make your web service universal. It should mean the same thing to a Coldfusion, Java or PHP caller.
Note, for example, that a Coldfusion XML object or dump is meaningless to a Java or PHP client. Chances are, the XML or dump will break the WSDL. Then you don't even have a web service to start with. In many cases, it is sufficient for the service to return a string, which is as universal as you can get.
There might be another problem in how you use Coldfusion to call a web service that returns XML. You should use cfhttp. Did you?
Hi thanks for your answer.
I am striving to make this webservice as universal as possible. I have only been returning dumps to my calling page to try and get a view of what's going on inside the component when I call it as a webservice. I wouldn't dream or returnin these back the client.
The major core of this idea was to create a single component that acts as a facade for a number of other components. Because of this the component needs to accept and return a dynamically variable number of arguments. Because of this I selected xml as this seemed like the ideal solution; I can pass in an out some xml that contains all the arguments. I was hoping to reuse some internal functions to provide external webservices, and use this facade architechture to add a layer of security and logging which doesn't exist with the current functions.
Do you have any suggestions of how I could best acheive something along these lines? Has someone already created a framework or methodology for creating webservices with Coldfusion which would provide this sort of functionality out of the box?
I use string as a platform neutral transport datatype for arguments and responses that are xml.
This removes the hassle of dealing with having to re-interpret another language's object representation of xml.
I receive xml, put it through IisXml(), then XmlParse(), then XmlValidate() against a schema. Then i know my data from my argument is good.
When i return xml data, i use ToString(MyXml). This way, on the other side, whatever language is being used can convert the xml as string into whatever native object model they want by loading the string into that lang's parse() factory. for java, i personally use xerces or xmlbeans.
If you have to use someone else's webservice and they don't send xml as string in the soap response, but rather xml in the actual soap response, then you can use GetSoapResponse(webserviceObjectVariable) to access the soap response in a coldfusion friendlier manner with it's native xml objects.
Do you have any suggestions