Copy link to clipboard
Copied
hi, i have run into an unusual behavior when invoking web services.
i am calling a web service that returns an XML like this:
<children>
<child>
<firstname>john</firstname>
<lastname>doe</lastname>
</child>
</children>
when invoking this web service from CF10, it works just fine. However, when invoking from CF11, i only get this:
<child>
<firstname>john</firstname>
<lastname>doe</lastname>
</child>
no <children>? for some reason, CF11 ignores/hides the topmost XML level. this doesn't happen on previous versions. why? the server that hosts the web service is CF11 too.
Report it as a Coldfusion bug. In any case, I would advise you to ensure that your web service returns a string, not an XML object.
That is because a web service should be universal. Callers from .NET, Java, PHP, ASP, and so on, will interpret a string in exactly the same way. Whereas, a Coldfusion XML object is a construct that is understood only in CFML.
Your return string should also begin with the XML declaration, like this
<?xml version="1.0" encoding="UTF-8"?>
<children>
<child>
<
...Copy link to clipboard
Copied
Report it as a Coldfusion bug. In any case, I would advise you to ensure that your web service returns a string, not an XML object.
That is because a web service should be universal. Callers from .NET, Java, PHP, ASP, and so on, will interpret a string in exactly the same way. Whereas, a Coldfusion XML object is a construct that is understood only in CFML.
Your return string should also begin with the XML declaration, like this
<?xml version="1.0" encoding="UTF-8"?>
<children>
<child>
<firstname>john</firstname>
<lastname>doe</lastname>
</child>
</children>
Then it is clear to the caller what the cat has brought in.
Copy link to clipboard
Copied
Thanks,
I have reported it as a bug. It does make more sense to return the XML as a string rather than a CF XML object. Though this is a pre-existing web service that is used by several internal CF apps.