WebService .net Engine XML structure returned as string or any?
PB 12.5.2 Buil 5602, win 7 64 bit , .Net Engine, SDK 7.1, framework 4/4.5
we have a webservice returns a XML structure, like organisation has departements has persons etc.. simple XML Strcture.
First try to get the result was to put in a string, we got error "there is an error in xml document (1 265)".
Second try in webservice around the XML structure we put CDATA tag an thats works to get in a string.
Third try the return is any, tried to put in a string also in a any everytime is null.
Some ideas?? or how must be the webservice declaration to get as return an XML Structure in a string in Powerbuilder and maybe after doing some process with the data in datawindow etc...???
Ricardo Jasso replied
I thought that maybe the XML structure was being sent as a binary type but apparently this is not the case. This is the case for a web service I consumed in one of my projects where an XML document was being sent as a binary type. And PB transformed the base64binary type to a byte in the proxy and it worked. I wonder why PB returned "any" in your proxy. But this is meaningless if the web services indeed sends the structure as a string.
But if we step a little bit back, I'm confused as to why you are modifying the WSDL file to find a match to the datatype of the response message when in fact one of the WSDL main purpose is to specify the data types of the parameters being sent back and forth. This allows the programming language to generate proxys with matching datatypes that can send and receive such messages. If the original WSDL file says the XML Structure should be received as a string then there should be no need to change the datatype to other than a string.
I think the problem is how PB is trying to store the XML structure and apparently it cannot handle it properly. A nested XML document is something that is not easily handled in web services. From the book "Web Services" by Alonso, Casati, Kuno, and Machiraju: "...XML does not always gracefully support the necessary data types, such as binary data (e.g., an image) or nested XML documents".
Is there a way the web service you are trying to access could send the XML structure as a binary? I would suggest you talk to the provider and see if they can change the XML structure datatype to something that PB can handle. Or wait until Appeon resolves this as it seems to be a PB bug. By the way, I use PB 12.5 Build 2511.