Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6373135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:19:34+00:00 2026-05-25T01:19:34+00:00

I have a Delphi XE app that consumes a web service written in Cold

  • 0

I have a Delphi XE app that consumes a web service written in Cold Fusion (I have no control over the service’s output format). I used the WSDL Importer in Delphi to create my unit for the calls to the web service. I am running into situations where I get an exception in Delphi that says “Element “data” does not contain a single text node”.

The relevant portion of the XML coming back from the web service when I get the exception is this:

<data soapenc:arrayType="xsd:anyType[][1]" xsi:type="soapenc:Array">
  <data soapenc:arrayType="xsd:anyType[2]" xsi:type="soapenc:Array">
    <data xsi:type="soapenc:string">6490</data>
    <data xsi:type="soapenc:string">Other Expense</data>
  </data>
</data>

If the XML from the web service contains more than one <data> child, no exception occurs.

<data soapenc:arrayType="xsd:anyType[][3]" xsi:type="soapenc:Array">
  <data soapenc:arrayType="xsd:anyType[2]" xsi:type="soapenc:Array">
    <data xsi:type="soapenc:string">2600</data>
    <data xsi:type="soapenc:string">Deferred Revenue</data>
  </data>
  <data soapenc:arrayType="xsd:anyType[2]" xsi:type="soapenc:Array">
    <data xsi:type="soapenc:string">4120</data>
    <data xsi:type="soapenc:string">Non-Credit Income</data>
  </data>
  <data soapenc:arrayType="xsd:anyType[2]" xsi:type="soapenc:Array">
    <data xsi:type="soapenc:string">6490</data>
    <data xsi:type="soapenc:string">Other Expense</data>
  </data>
</data>

What causes this exception and is there a way around it without being able to change the web service itself?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:19:35+00:00Added an answer on May 25, 2026 at 1:19 am

    I don’t know what is causing the error, but yes, there is a way around it. You can use the RIO_AfterExecute() handler to modify the SOAPResponse, to alter the XML to “make it fit”. It’s an ugly, “bigger hammer” approach, but it ultimately lets you fiddle with the data to get around all sorts of problems.
    Looking at your two examples, I’d try using stringreplace to replace ‘xsd:anyType[][1]’ with ‘xsd:anyType[][3]’. If that doesn’t work, try injecting another set of data with empty values, to make it seem like there’s not just one.

    You’ll need a RIO object, and then you hook it up to a handler like this:

    MyRIO.OnAfterExecute := self.RIO_AfterExecute;
    

    In my case, “self” refers to a class that I’ve written around my SOAP stuff.

    Be sure to set your position back to 0 when you’re done fiddling with the request.

    Here is some untested code:

    procedure MyWrapper.RIO_AfterExecute(const MethodName: string; SOAPResponse: TStream);
    var 
      SL : TStringList;   
    begin
      // do stuff with the SOAPResponse here. 
      // It's a stream, so I like to load it into a stringlist
      // ex: 
        SL := TStringList.Create;
        try
          SOAPResponse.Position := 0;
          SL.LoadFromSTream(SOAPREsponse);
          // fiddle with stringreplace here, to doctor up the SL.text.
          SOAPResponse.Position := 0;
          SOAPResponse.size := length(SL.Text);
          SL.SaveToStream(SOAPResponse);
        finally
          SL.free;
        end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Delphi + SQL Server (2k or 2005 supported) app that is
My computer crashed recently. We have a Delphi app that takes a lot of
I have a Delphi 2006 app that pops up a modal alert dialog when
I have a console app that must disable or enable some operations when output
I have a Delphi app where I display a list of games that have
I have this problem for days now. I have a delphi app that i
I have a Delphi 2006 app that I am adding code to process some
We have a Delphi COM component being called from an ISAPI web app. The
I have a Delphi app that places the computer into screensave using hWnd :=
I have a Delphi app that references a datafile of 28-byte records. The file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.