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

  • Home
  • SEARCH
  • 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 497183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:45:26+00:00 2026-05-13T05:45:26+00:00

I’m trying to write a simple SOAP client using SOAP::Lite . After making a

  • 0

I’m trying to write a simple SOAP client using SOAP::Lite. After making a request, the response only seems to be parsed into perl data structure a couple levels down. After that it’s just a string of the remaining XML. I feel like it would be really kludgy to take that string and parse it manually with another XML parser.

my $response = $soap->getVersionInfo;    
my $data = $response->dataof('//getVersionInfoResponse');

The SOAP response looks like this in the SOAP::Lite trace:

<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <ns:getVersionInfoResponse xmlns:ns="http://webservice.jchem.chemaxon">
         <ns:return>
            &lt;Info>
            &lt;JChem>
            &lt;Version>5.2.6&lt;/Version>
            &lt;/JChem>
            &lt;Java>
            &lt;Vendor>Sun Microsystems Inc.&lt;/Vendor>
            &lt;VmName>Java HotSpot(TM) Client VM&lt;/VmName>
            &lt;Version>1.6.0_05&lt;/Version>
            &lt;/Java>
            &lt;Os>
            &lt;Arch>x86&lt;/Arch>
            &lt;Name>Windows XP&lt;/Name>
            &lt;Version>5.1&lt;/Version>
            &lt;/Os>
            &lt;/Info>
         </ns:return>
      </ns:getVersionInfoResponse>
   </soapenv:Body>
</soapenv:Envelope>

But what gets parsed into $data looks like this (from Data::Dumper::Concise):

\bless( {
    _attr => {},
    _name => "getVersionInfoResponse",
    _prefix => "ns",
    _signature => [],
    _uri => "http://webservice.jchem.chemaxon",
    _value => [
      {
        return => "<Info>\n<JChem>\n<Version>5.2.6</Version>\n</JChem>\n<Java>\n<Vendor>Sun Microsystems Inc.</Vendor>\n<VmName>Java HotSpot(TM) Client VM</VmName>\n<Version>1.6.0_05</Version>\n</Java>\n<Os>\n<Arch>x86</Arch>\n<Name>Windows XP</Name>\n<Version>5.1</Version>\n</Os>\n</Info>\n"
      }
    ]
  }, 'SOAP::Data' )

This is a simple example, but for more complex responses, it could become a huge hassle to have to parse out that XML.

I found this post on the SOAP::Lite mailing list (from 2003!) that had a worrisome quote on it:

Keep in mind the requirement that any
attributes not natively known to SOAP
must be namespace-qualified.

And I noticed that everything that wasn’t getting parsed was not namespaced. Is there a way to force SOAP::Lite to parse that non-namespaced xml? Is that even the problem?

UPDATE:
It turns out SOAP::Lite was Doing The Right Thing. I’d overlooked a note in the service docs that that said

Note: The special characters inside
<ns:return> tag are encoded to
entities. (e.g. an xml return value
will contain < characters, which will
be encoded to &lt; entities) Therefore
entity decoding is needed on the
client side.

What I thought was just a trace output inconsistency was actually the problem. SOAP::Lite being nice and unescaping the entities before they ended up in the Dumper confused me as well. I originally included the documentation’s example because it was already formatted nicely. Now the actual output is shown. Plus, everyone knows &lt; is the same as <, right? Right? ;_;

As of now I’m parsing the string with XML::LibXML, so the question still stands. Can I force SOAP::Lite to parse that interior XML string, even though it’s been escaped?

  • 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-13T05:45:26+00:00Added an answer on May 13, 2026 at 5:45 am

    From what I learned on the SOAP::Lite mailing list (post), SOAP::Lite’s intention is to only handle the protocol and envelope, not the interior of the message. I ended up using XML::Simple to parse the content of the response.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
I am trying to render a haml file in a javascript response like so:
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.