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

encodingStyle attribute in method element

Expand Messages
  • davent
    Hello all. This is a simple, stupid question, but I cannot seem to find an answer. I m using SOAP::Lite to run a simple client. $lite = SOAP::Lite - uri(
    Message 1 of 2 , Dec 6, 2001
    • 0 Attachment
      Hello all. This is a simple, stupid question, but I cannot seem to
      find an answer.

      I'm using SOAP::Lite to run a simple client.

      $lite = SOAP::Lite
      ->uri( "urn:foo" )
      -> proxy ( "http://foo/foo" )
      -> foo();
      print $lite->result

      My problem is, the soap reply body contains XML, so using the above
      code the server wants to escape the XML response (i.e. change < to
      <).

      <m:fooReply xmlns:m="Some-URI">
      <foo>bar</foo>
      </m:fooReply>

      becomes

      <m:fooReply xmlns:m="Some-URI">
      <foo>bar</foo>
      </m:fooReply>

      To stop this from happening, I need to set the SOAP-ENV:encodingStyle
      attribute of the methodcall element to "http://xml.apache.org/xml-
      soap/literalxml"

      There should be a really easy way to do this, but I can't seem to
      find it. Any help would be appreciated.

      Thanks!

      ~t
    • Paul Kulchenko
      ... You need to use pseudotype xml to not escape your XML fragment: return SOAP::Data- type(xml = bar ); You can specify attributes for method
      Message 2 of 2 , Dec 10, 2001
      • 0 Attachment
        --- davent <stuff_98@...> wrote:

        > My problem is, the soap reply body contains XML, so using the above
        > code the server wants to escape the XML response (i.e. change < to
        > <).

        You need to use pseudotype 'xml' to not escape your XML fragment:

        return SOAP::Data->type(xml => '<foo>bar</foo>');

        You can specify attributes for method element using this code:

        my $method = SOAP::Data->name('method')->encodingStyle("");
        $soap->call($method, @parameters);

        More information is available in SOAP::Lite documentation. Check
        description for call() method.

        For description how to do that on server side you may check SOAP
        Cookbook (http://cookbook.soaplite.com/), item 'Changing attributes
        for method element in response'. Hope it helps.

        Best wishes, Paul.

        --- davent <stuff_98@...> wrote:
        > Hello all. This is a simple, stupid question, but I cannot seem to
        >
        > find an answer.
        >
        > I'm using SOAP::Lite to run a simple client.
        >
        > $lite = SOAP::Lite
        > ->uri( "urn:foo" )
        > -> proxy ( "http://foo/foo" )
        > -> foo();
        > print $lite->result
        >
        > My problem is, the soap reply body contains XML, so using the above
        >
        > code the server wants to escape the XML response (i.e. change < to
        > <).
        >
        > <m:fooReply xmlns:m="Some-URI">
        > <foo>bar</foo>
        > </m:fooReply>
        >
        > becomes
        >
        > <m:fooReply xmlns:m="Some-URI">
        > <foo>bar</foo>
        > </m:fooReply>
        >
        > To stop this from happening, I need to set the
        > SOAP-ENV:encodingStyle
        > attribute of the methodcall element to "http://xml.apache.org/xml-
        > soap/literalxml"
        >
        > There should be a really easy way to do this, but I can't seem to
        > find it. Any help would be appreciated.
        >
        > Thanks!
        >
        > ~t
        >
        >
        > ------------------------ Yahoo! Groups Sponsor
        >
        > To unsubscribe from this group, send an email to:
        > soaplite-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to
        > http://docs.yahoo.com/info/terms/
        >
        >


        __________________________________________________
        Do You Yahoo!?
        Send your FREE holiday greetings online!
        http://greetings.yahoo.com
      Your message has been successfully submitted and would be delivered to recipients shortly.