Loading ...
Sorry, an error occurred while loading the content.

Re: [soaplite] Passing & via SOAP::Lite

Expand Messages
  • Chris Woodfield
    This is a normal substitution and *should* happen automatically; & (like ) is an illegal XML character, so it gets encoded as & in the SOAP XML
    Message 1 of 4 , Jul 4, 2008
    View Source
    • 0 Attachment
      This is a normal substitution and *should* happen automatically; &
      (like < and >) is an illegal XML character, so it gets encoded as
      & in the SOAP XML message and is parsed back out at decode.

      However, older versions of SOAP::Lite didn't do this substitution; I
      just upgraded all my Ubuntu 6 boxen from 0.66 (the version from the
      distribution) to the latest 0.71 from CPAN in order to fix this
      specific issue. I'm sure you'll find other SOAP implementations that
      don't do this automatically either.

      HTH,

      -Chris

      On Jul 4, 2008, at 5:59 AM, Mark Knoop wrote:

      > Hi
      >
      > I suspect this may be obvious but I am not clear on what happens
      > where.
      >
      > I have to make a SOAP method call to a 3rd party, passing a return
      > URL as
      > one of the parameters, and then redirect to the url they give me
      > back. They
      > then redirect back to the URL I passed them. The URL has GET srtyle
      > CGI
      > parameters which I was using ; to seperate as with an older version
      > od SOAP
      > it just did not work at all with & (also I understand ; is the new
      > standard). Unfortunatle we found some circumstances out of our
      > control where
      > ; breaks things so I changed back to &. Sure enough this broke the
      > SOAP
      > requests again but before I started askin questions I updated to the
      > most
      > recent SOAP::Lite module and it appeared to start working. On closer
      > examination the QUERY_STRING of the request after the redirection
      > back to us
      > contains '&'s instead of '&'s.
      >
      > Now one thing that confused me is that this does not seem to break
      > things
      > under all circumstances (I realise this is OT but does anyone know
      > if CGI.pm
      > auto unescapes & ?)
      >
      > However it does seem to be causing weirdnesses in some scenarios.
      >
      > So the question is what is the correct way to pass & as a SOAP::Lite
      > method
      > parameter so that it is interpreted as a & at the server side? Is it
      > as
      > simple as escaping it before making the SOAP method call? Or is this
      > happening automatically? In which case there is nothing I can do to
      > get the
      > QUERY_STRING correct at source?
      >
      > If anyone can explain or point me in the right direction to find out
      > exactly
      > what happens behind the scenes with escaping/unescaping characters in
      > SOAP::Lite it would really help me to decide the best way of doing
      > this...
      >
      > Regards
      > Mark
      >
      >
      >
    • Mark Knoop
      Rahed - ... Chris - ... Thanks guys - this helped alot. I was a bit unsure re the behaviour changing in the newer version of SOAP::Lite - also I was using XML
      Message 2 of 4 , Jul 14, 2008
      View Source
      • 0 Attachment
        Rahed -
        > Have a look at SOAP/Lite.pm. Description starting at line 359
        > (SOAP::Lite, v.0.710.07) may be helpful.
        > hth
        >
        > --
        > Radek
        >

        Chris -
        > This is a normal substitution and *should* happen automatically; &
        > (like < and >) is an illegal XML character, so it gets encoded as
        > & in the SOAP XML message and is parsed back out at decode.
        >
        > However, older versions of SOAP::Lite didn't do this substitution; I
        > just upgraded all my Ubuntu 6 boxen from 0.66 (the version from the
        > distribution) to the latest 0.71 from CPAN in order to fix this
        > specific issue. I'm sure you'll find other SOAP implementations that
        > don't do this automatically either.
        >
        > HTH,
        >


        Thanks guys - this helped alot. I was a bit unsure re the behaviour changing
        in the newer version of SOAP::Lite - also I was using XML tokens in my logs
        which were encoding the & again and confusing me. I got it working now.

        Cheers
        Mark
      Your message has been successfully submitted and would be delivered to recipients shortly.