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

Deserialization problem with URL and < bracket in soap message

Expand Messages
  • keith5000g
    I m able to send SOAP messages to a .NET WCF service via SOAP Lite successfully, unless the message meets these 2 criteria: - contains a less-than bracket
    Message 1 of 3 , Jul 8, 2010
    • 0 Attachment
      I'm able to send SOAP messages to a .NET WCF service via SOAP Lite successfully, unless the message meets these 2 criteria:
      - contains a less-than bracket <
      - contains a URL beginning with http://

      In this scenario, I get the following error on the line where I invoke the service method:
      a:DeserializationFailed: The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'ProcessLog'. The ' ' character, hexadecimal value 0x20, cannot be included in a name. Line 1, position 419. at ./test.pl line 27.

      To generate this error, I simply passed the following string (minus quotes) to my service method, and this is the only parameter I'm passing:
      " a< Go to http://google.com ok now"

      The problem is not with the ' ' character as it suggests. (Depending on what else is in the message it will complain about other characters, for example the @ sign.) But I have nailed it down to the 2 criteria mentioned above.

      This does not happen in the latest SOAP Lite. I must be using an older version though I don't know how to figure out what that is. (If you need to know, please let me know how to figure it out on a Linux box :) )

      My code is below. I'm not doing anything fancy as you can see. I'm assuming I either have to do some extra encoding or there is a bug in this version of SOAP Lite. Any ideas?


      use SOAP::Lite;

      my $line = ' a< Go to http://google.com ok now';
      my $oSoap = SOAP::Lite
      -> uri('http://tempuri.org/')
      -> on_action(sub{sprintf '%sILogService/%s', @_})
      -> proxy('http://mycomputer/MyService/LogService.svc?wsdl');

      my $oResponse = $oSoap->ProcessLog(SOAP::Data->new(name => 'logEntryText', value => $line));
    • Scott Seely
      Try encoding the
      Message 2 of 3 , Jul 8, 2010
      • 0 Attachment

        Try encoding the < symbol as &lt;.

         

        From: soaplite@yahoogroups.com [mailto:soaplite@yahoogroups.com] On Behalf Of keith5000g
        Sent: Thursday, July 08, 2010 4:02 PM
        To: soaplite@yahoogroups.com
        Subject: [soaplite] Deserialization problem with URL and < bracket in soap message

         

         

        I'm able to send SOAP messages to a .NET WCF service via SOAP Lite successfully, unless the message meets these 2 criteria:
        - contains a less-than bracket <
        - contains a URL beginning with http://

        In this scenario, I get the following error on the line where I invoke the service method:
        a:DeserializationFailed: The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'ProcessLog'. The ' ' character, hexadecimal value 0x20, cannot be included in a name. Line 1, position 419. at ./test.pl line 27.

        To generate this error, I simply passed the following string (minus quotes) to my service method, and this is the only parameter I'm passing:
        " a< Go to http://google.com ok now"

        The problem is not with the ' ' character as it suggests. (Depending on what else is in the message it will complain about other characters, for example the @ sign.) But I have nailed it down to the 2 criteria mentioned above.

        This does not happen in the latest SOAP Lite. I must be using an older version though I don't know how to figure out what that is. (If you need to know, please let me know how to figure it out on a Linux box :) )

        My code is below. I'm not doing anything fancy as you can see. I'm assuming I either have to do some extra encoding or there is a bug in this version of SOAP Lite. Any ideas?

        use SOAP::Lite;

        my $line = ' a< Go to http://google.com ok now';
        my $oSoap = SOAP::Lite
        -> uri('http://tempuri.org/')
        -> on_action(sub{sprintf '%sILogService/%s', @_})
        -> proxy('http://mycomputer/MyService/LogService.svc?wsdl');

        my $oResponse = $oSoap->ProcessLog(SOAP::Data->new(name => 'logEntryText', value => $line));

      • kooganani
        This method shoud work for finding the version number for most modules: $ perl -MSOAP::Lite -e print $SOAP::Lite::VERSION n ; 0.66.1 -Aaron
        Message 3 of 3 , Jul 8, 2010
        • 0 Attachment
          This method shoud work for finding the version number for most modules:

          $ perl -MSOAP::Lite -e 'print "$SOAP::Lite::VERSION\n";'
          0.66.1

          -Aaron

          --- In soaplite@yahoogroups.com, "keith5000g" <keith5000@...> wrote:
          > This does not happen in the latest SOAP Lite. I must be using an older version though I don't know how to figure out what that is. (If you need to know, please let me know how to figure it out on a Linux box :) )
        Your message has been successfully submitted and would be delivered to recipients shortly.