• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

problems with xml returned when invoking a web service with CF11

New Here ,
Sep 16, 2015 Sep 16, 2015

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.

Views

233

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 17, 2015 Sep 17, 2015

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>

          <

...

Votes

Translate

Translate
Community Expert ,
Sep 17, 2015 Sep 17, 2015

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 17, 2015 Sep 17, 2015

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation