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

SOAP 1.1 -vs- 1.2

Expand Messages
  • Tom Mornini
    Hello all! We re getting near deploying our first SOAP based service, and I m beginning to think that perhaps we can t get there from here... :-) We have some
    Message 1 of 5 , Feb 26, 2002
    • 0 Attachment
      Hello all! We're getting near deploying our first SOAP based service, and
      I'm beginning to think that perhaps we can't get there from here... :-)

      We have some fields that must be explicitly binary clean.

      Reading through this list, and searching google, I've found that, on the
      SOAP::Lite client side (server is SOAP::Lite as well):

      SOAP::Data->type('base64' => $b);

      will encode the data as base 64, and identify it in the SOAP XML as
      SOAP-ENC:base64, which seems to be correct in and of itself.

      My problem, like so often in the past, begins with Microsoft. :-)

      Their toolkit appears to support SOAP 1.2, which itself supports
      binaryBase64 type.

      However, I can't get SOAP::Lite to serialize into 1.2

      After reading through the code, I found the SOAP::Lite->soapversion and
      SOAP::Serializer->soapversion methods. I believe I understand how they
      work, and how to use them, however this sample piece of code would
      indicate that I am wrong in that belief.

      #!/usr/bin/perl -w

      use strict;

      use SOAP::Lite +trace => qw( debug );

      my $version = $ARGV[0];

      my $type = $ARGV[1];

      unless ( defined($version) && defined($type) ) {
      die "usage: $0 version type\n";
      }

      my $s11 = SOAP::Lite->new(
      soapversion => $version,
      uri => 'http://soap.soap.com/example',
      proxy => 'http://254.254.254.254/SOAP');

      $s11->example( SOAP::Data->type($type => 'test') );

      When run produces: ( edited for clarity )

      bash-2.04$ ./test_soap.pl 1.1 base64

      <?xml version="1.0" encoding="UTF-8"?>
      <SOAP-ENV:Envelope
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema">
      <SOAP-ENV:Body>
      <namesp1:example xmlns:namesp1="http://soap.soap.com/example">
      <c-gensym3 xsi:type="SOAP-ENC:base64">
      dGVzdA==
      </c-gensym3>
      </namesp1:example>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

      bash-2.04$ ./test_soap.pl 1.2 base64

      <?xml version="1.0" encoding="UTF-8"?>
      <Envelope
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema">
      <Body>
      <namesp1:example xmlns:namesp1="http://soap.soap.com/example">
      <c-gensym3 xsi:type="base64">
      dGVzdA==
      </c-gensym3>
      </namesp1:example>
      </Body>
      </Envelope>

      bash-2.04$ ./test_soap.pl 1.2 base64Binary

      Schema/namespace for type 'base64Binary' is not specified

      The results are certainly different!

      I believe the 1st run is completely correct.

      The second is bizarre because it's not using the 1.2 schemas, and the
      elements appear to be strangely unqualified (<Envelope> rather than
      <SOAP-ENV:Envelope>)

      And the third is almost certainly wrong as base64Binary should be
      recognized as part of SOAP 1.2.

      I have a feeling that I'm setting soapversion incorrectly, but there is
      code (and I've triggered it) warning when it's set to incorrect values.

      And, I have a feeling that once the client serialization is correct,
      that the server side deserialization will work perfectly.

      Any help would be greatly appreciated.

      --
      -- Tom Mornini
      -- InfoMania Printing and Prepress
    • Duncan Cameron
      ... You might find that explicitly setting the schema will help $s- xmlschema( 2001 ); Not sure how it operates with the SOAP version though. Duncan Cameron
      Message 2 of 5 , Feb 26, 2002
      • 0 Attachment
        On 2002-02-26 Tom Mornini wrote:
        >Hello all! We're getting near deploying our first SOAP based service, and
        >I'm beginning to think that perhaps we can't get there from here... :-)
        >
        >We have some fields that must be explicitly binary clean.
        >
        >Reading through this list, and searching google, I've found that, on the
        >SOAP::Lite client side (server is SOAP::Lite as well):
        >
        >SOAP::Data->type('base64' => $b);
        >
        >will encode the data as base 64, and identify it in the SOAP XML as
        >SOAP-ENC:base64, which seems to be correct in and of itself.
        >
        >My problem, like so often in the past, begins with Microsoft. :-)
        >
        >Their toolkit appears to support SOAP 1.2, which itself supports
        >binaryBase64 type.
        >
        >However, I can't get SOAP::Lite to serialize into 1.2
        >
        >After reading through the code, I found the SOAP::Lite->soapversion and
        >SOAP::Serializer->soapversion methods. I believe I understand how they
        >work, and how to use them, however this sample piece of code would
        >indicate that I am wrong in that belief.
        >
        >#!/usr/bin/perl -w
        >
        >use strict;
        >
        >use SOAP::Lite +trace => qw( debug );
        >
        >my $version = $ARGV[0];
        >
        >my $type = $ARGV[1];
        >
        >unless ( defined($version) && defined($type) ) {
        > die "usage: $0 version type\n";
        >}
        >
        >my $s11 = SOAP::Lite->new(
        > soapversion => $version,
        > uri => 'http://soap.soap.com/example',
        > proxy => 'http://254.254.254.254/SOAP');
        >
        >$s11->example( SOAP::Data->type($type => 'test') );
        >
        >When run produces: ( edited for clarity )
        >
        >bash-2.04$ ./test_soap.pl 1.1 base64
        >
        ><?xml version="1.0" encoding="UTF-8"?>
        ><SOAP-ENV:Envelope
        > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
        > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
        > xmlns:xsd="http://www.w3.org/1999/XMLSchema">
        > <SOAP-ENV:Body>
        > <namesp1:example xmlns:namesp1="http://soap.soap.com/example">
        > <c-gensym3 xsi:type="SOAP-ENC:base64">
        > dGVzdA==
        > </c-gensym3>
        > </namesp1:example>
        > </SOAP-ENV:Body>
        ></SOAP-ENV:Envelope>
        >
        >bash-2.04$ ./test_soap.pl 1.2 base64
        >
        ><?xml version="1.0" encoding="UTF-8"?>
        ><Envelope
        > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
        > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
        > xmlns:xsd="http://www.w3.org/1999/XMLSchema">
        > <Body>
        > <namesp1:example xmlns:namesp1="http://soap.soap.com/example">
        > <c-gensym3 xsi:type="base64">
        > dGVzdA==
        > </c-gensym3>
        > </namesp1:example>
        > </Body>
        ></Envelope>
        >
        >bash-2.04$ ./test_soap.pl 1.2 base64Binary
        >
        >Schema/namespace for type 'base64Binary' is not specified
        >
        >The results are certainly different!
        >
        >I believe the 1st run is completely correct.
        >
        >The second is bizarre because it's not using the 1.2 schemas, and the
        >elements appear to be strangely unqualified (<Envelope> rather than
        ><SOAP-ENV:Envelope>)
        >
        >And the third is almost certainly wrong as base64Binary should be
        >recognized as part of SOAP 1.2.
        >
        >I have a feeling that I'm setting soapversion incorrectly, but there is
        >code (and I've triggered it) warning when it's set to incorrect values.
        >
        >And, I have a feeling that once the client serialization is correct,
        >that the server side deserialization will work perfectly.
        >
        >Any help would be greatly appreciated.
        >
        >--
        >-- Tom Mornini
        >-- InfoMania Printing and Prepress
        >

        You might find that explicitly setting the schema will help

        $s->xmlschema('2001');

        Not sure how it operates with the SOAP version though.

        Duncan Cameron
      • Tom Mornini
        ... Thank you! That worked perfectly. Here s what I found: my $s = SOAP::Lite- new( soapversion = 1.2, xmlschema = 2001 , uri =
        Message 3 of 5 , Feb 26, 2002
        • 0 Attachment
          On Tuesday, February 26, 2002, at 11:28 PM, Duncan Cameron wrote:

          > You might find that explicitly setting the schema will help
          >
          > $s->xmlschema('2001');
          >
          > Not sure how it operates with the SOAP version though.

          Thank you! That worked perfectly. Here's what I found:

          my $s = SOAP::Lite->new(
          soapversion => 1.2,
          xmlschema => '2001',
          uri => 'http://soap.soap.com/example',
          proxy => 'http://254.254.254.254/SOAP');

          worked fine, exactly as expected. I commented out the soapversion, and
          that didn't work (still complained about no base64Binary...

          Thanks again for your quick response.

          --
          -- Tom Mornini
          -- InfoMania Printing and Prepress
          --
          -- ICQ: 113526784, AOL: tmornini, Yahoo: tmornini, MSN: tmornini
        • Paul Kulchenko
          Hi, Tom! ... Just to clarify the situation (and sorry for my long absence from the list; I was traveling for two weeks with occasional access to my email. btw,
          Message 4 of 5 , Feb 27, 2002
          • 0 Attachment
            Hi, Tom!

            > my $s = SOAP::Lite->new(
            > soapversion => 1.2,
            > xmlschema => '2001',
            > uri => 'http://soap.soap.com/example',
            > proxy => 'http://254.254.254.254/SOAP');
            >
            > worked fine, exactly as expected. I commented out the soapversion,
            Just to clarify the situation (and sorry for my long absence from the
            list; I was traveling for two weeks with occasional access to my
            email. btw, thanks for your help, Duncan ;)).

            use SOAP::Lite soapversion => 1.2;

            is the correct (compile-time) usage that will generate proper
            namespaces.

            SOAP::Lite->soapversion(1.2);

            does the same thing in run-time, which is incorrect, yet allowed.
            I'll probably generate fault in this case, because it doesn't do what
            it should do.

            If you just want to use 2001 Schema (and I believe it'll be
            sufficient in this case), then 'xmlschema => 2001' will be enough. If
            you want to play with SOAP 1.2, then 'soapversion => 1.2' will be
            enough and you don't need to use xmlschema => 2001 in this case, it's
            used with SOAP 1.2 by default. Hope it makes it more clear.

            Best wishes, Paul.

            --- Tom Mornini <tmornini@...> wrote:
            > On Tuesday, February 26, 2002, at 11:28 PM, Duncan Cameron wrote:
            >
            > > You might find that explicitly setting the schema will help
            > >
            > > $s->xmlschema('2001');
            > >
            > > Not sure how it operates with the SOAP version though.
            >
            > Thank you! That worked perfectly. Here's what I found:
            >
            > my $s = SOAP::Lite->new(
            > soapversion => 1.2,
            > xmlschema => '2001',
            > uri => 'http://soap.soap.com/example',
            > proxy => 'http://254.254.254.254/SOAP');
            >
            > worked fine, exactly as expected. I commented out the soapversion,
            > and
            > that didn't work (still complained about no base64Binary...
            >
            > Thanks again for your quick response.
            >
            > --
            > -- Tom Mornini
            > -- InfoMania Printing and Prepress
            > --
            > -- ICQ: 113526784, AOL: tmornini, Yahoo: tmornini, MSN: tmornini
            >
            >
            > ------------------------ 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!?
            Yahoo! Greetings - Send FREE e-cards for every occasion!
            http://greetings.yahoo.com
          • Tom Mornini
            ... Hope you had a good trip! ... That makes sense! ... OK. That s interesting and useful information. Thank you very much for your time. -- -- Tom Mornini --
            Message 5 of 5 , Feb 27, 2002
            • 0 Attachment
              On Wednesday, February 27, 2002, at 01:41 PM, Paul Kulchenko wrote:

              > > my $s = SOAP::Lite->new(
              > >   soapversion => 1.2,
              > >   xmlschema   => '2001',
              > >   uri         => 'http://soap.soap.com/example',
              > >   proxy       => 'http://254.254.254.254/SOAP');
              > >
              > > worked fine, exactly as expected. I commented out the soapversion,
              > Just to clarify the situation (and sorry for my long absence from the
              > list; I was traveling for two weeks with occasional access to my
              > email. btw, thanks for your help, Duncan ;)).

              Hope you had a good trip!

              > use SOAP::Lite soapversion => 1.2;
              >
              > is the correct (compile-time) usage that will generate proper
              > namespaces.
              >
              > SOAP::Lite->soapversion(1.2);
              >
              > does the same thing in run-time, which is incorrect, yet allowed.
              > I'll probably generate fault in this case, because it doesn't do what
              > it should do.

              That makes sense!

              > If you just want to use 2001 Schema (and I believe it'll be
              > sufficient in this case), then 'xmlschema => 2001' will be enough. If
              > you want to play with SOAP 1.2, then 'soapversion => 1.2' will be
              > enough and you don't need to use xmlschema => 2001 in this case, it's
              > used with SOAP 1.2 by default. Hope it makes it more clear.

              OK. That's interesting and useful information. Thank you very much for
              your time.

              --
              -- Tom Mornini
              -- eWingz Systems, Inc.
              --
              -- ICQ: 113526784, AOL: tmornini, Yahoo: tmornini, MSN: tmornini
            Your message has been successfully submitted and would be delivered to recipients shortly.