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

apache soap breaks with 0.52

Expand Messages
  • werner ackerl
    after i upgraded my server to 0.52, apache soap refuses to parse the array type 1) error message No Deserializer found to deserialize a
    Message 1 of 6 , Nov 22, 2001
    • 0 Attachment
      after i upgraded my server to 0.52, apache soap
      refuses to parse the array type

      1) error message
      No Deserializer found to deserialize a
      'http://namespaces.soaplite.com/perl:Array' using
      encoding style
      'http://schemas.xmlsoap.org/soap/encoding/'.]
      at java.lang.Throwable.<init>(Throwable.java:96)
      at java.lang.Exception.<init>(Exception.java:44)
      at org.apache.soap.SOAPException.<init>(Unknown
      Source)
      at org.apache.soap.SOAPException.<init>(Unknown
      Source)
      at org.apache.soap.rpc.Call.invoke(Unknown Source)

      ...

      2) xml fragment of a response from a 0.51 version
      <?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"
      xmlns:xmlsoap="http://xml.apache.org/xml-soap">
      <SOAP-ENV:Body>
      <namesp1:getUpdateResponse
      xmlns:namesp1="http://bobo.lokales.netz/abfdv">
      <daten SOAP-ENC:arrayType="xmlsoap:Map[245]"
      xsi:type="SOAP-ENC:Array">
      ...

      3) xml fragment of a response from a 0.52 version
      <?xml version="1.0" encoding="UTF-8"?>
      <SOAP-ENV:Envelope

      xmlns:namesp2="http://namespaces.soaplite.com/perl"

      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"


      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xmlsoap="http://xml.apache.org/xml-soap"

      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"


      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

      xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <SOAP-ENV:Body>
      <namesp1:getUpdateResponse
      xmlns:namesp1="http://bobo.lokales.netz/abfdv">
      <daten SOAP-ENC:arrayType="xmlsoap:Map[11]"
      xsi:type="namesp2:Array">
      ...



      __________________________________________________
      Do You Yahoo!?
      Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
      http://geocities.yahoo.com/ps/info1
    • Paul Kulchenko
      Hi, werner! ... Looks like a bug to me, but I can t reproduce it. Arrays that my code is generating are always have SOAP-ENC:Array type. What s your code on
      Message 2 of 6 , Nov 22, 2001
      • 0 Attachment
        Hi, werner!

        > <daten SOAP-ENC:arrayType="xmlsoap:Map[11]"
        > xsi:type="namesp2:Array">
        Looks like a bug to me, but I can't reproduce it. Arrays that my code
        is generating are always have SOAP-ENC:Array type. What's your code
        on server side that generates this response? Do you use
        autotype?Thanks.

        Best wishes, Paul.

        --- werner ackerl <cjbecjbe@...> wrote:
        > after i upgraded my server to 0.52, apache soap
        > refuses to parse the array type
        >
        > 1) error message
        > No Deserializer found to deserialize a
        > 'http://namespaces.soaplite.com/perl:Array' using
        > encoding style
        > 'http://schemas.xmlsoap.org/soap/encoding/'.]
        > at java.lang.Throwable.<init>(Throwable.java:96)
        > at java.lang.Exception.<init>(Exception.java:44)
        > at org.apache.soap.SOAPException.<init>(Unknown
        > Source)
        > at org.apache.soap.SOAPException.<init>(Unknown
        > Source)
        > at org.apache.soap.rpc.Call.invoke(Unknown Source)
        >
        > ...
        >
        > 2) xml fragment of a response from a 0.51 version
        > <?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"
        > xmlns:xmlsoap="http://xml.apache.org/xml-soap">
        > <SOAP-ENV:Body>
        > <namesp1:getUpdateResponse
        > xmlns:namesp1="http://bobo.lokales.netz/abfdv">
        > <daten SOAP-ENC:arrayType="xmlsoap:Map[245]"
        > xsi:type="SOAP-ENC:Array">
        > ...
        >
        > 3) xml fragment of a response from a 0.52 version
        > <?xml version="1.0" encoding="UTF-8"?>
        > <SOAP-ENV:Envelope
        >
        > xmlns:namesp2="http://namespaces.soaplite.com/perl"
        >
        > SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        >
        >
        > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        > xmlns:xmlsoap="http://xml.apache.org/xml-soap"
        >
        > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
        >
        >
        > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
        >
        > xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        > <SOAP-ENV:Body>
        > <namesp1:getUpdateResponse
        > xmlns:namesp1="http://bobo.lokales.netz/abfdv">
        > <daten SOAP-ENC:arrayType="xmlsoap:Map[11]"
        > xsi:type="namesp2:Array">
        > ...
        >
        >
        >
        > __________________________________________________
        > Do You Yahoo!?
        > Yahoo! GeoCities - quick and easy web site hosting, just
        > $8.95/month.
        > http://geocities.yahoo.com/ps/info1
        >
        > 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! GeoCities - quick and easy web site hosting, just $8.95/month.
        http://geocities.yahoo.com/ps/info1
      • werner ackerl
        ... wrote: Hi, werner! SOAP-ENC:arrayType= xmlsoap:Map[11] xsi:type= namesp2:Array Looks like a bug to me, but I can t
        Message 3 of 6 , Nov 23, 2001
        • 0 Attachment
          --- Paul Kulchenko wrote:
          > Hi, werner! > > > SOAP-ENC:arrayType="xmlsoap:Map[11]" > > xsi:type="namesp2:Array"> > Looks like a bug to me, but I can't reproduce it. > Arrays that my code > is generating are always have SOAP-ENC:Array type. > What's your code > on server side that generates this response? Do you > use > autotype?Thanks. >
          i try to avoid autotyping whereever possible. java doesn't like being presented an integer when it's expecting a string.#!/usr/bin/perl -wuse SOAP::Transport::HTTP;my $server = SOAP::Transport::HTTP::CGI -> objects_by_reference( qw(abfdv) ) -> dispatch_to('abfdv') -> handle() ;package abfdv; use strict; use HTML::Entities; use URI::Escape; use vars qw(@ISA);BEGIN { @ISA = qw(SOAP::Server::Parameters); }sub getUpdate { my($loginname,$password,$bsBundesland,$sTabelle,$sLocalVersion ) = @{pop->method}{qw( username password bundesland table localVersion )};my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time); my $sSystemTime = sprintf( "%04d-%02d-%02sT%02d:%02d:%02d.000Z", $year + 1900, $mon + 1, $mday, $hour, $min, $sec );# input file is tab separated values; with every value enclosed in # in ", like staroffice uses to write open IN, " ; chomp( $titleLine ); my @titles = split( /["\t]+/, $titleLine ); my (@ary, $line, $lineNum); while( $line = ) { my @items = split( /["\t]+/, $line ); push @ary, SOAP::Data->type( map => { 'Abfallnummer' => SOAP::Data->type( string => uri_escape( $items[1] )), 'Bezeichnung' => SOAP::Data->type( string => uri_escape( $items[2] )), 'Gefahr' => SOAP::Data->type( string => uri_escape( $items[3] )), 'Abfall-Besitzer Nummer' => SOAP::Data->type( string => uri_escape( $items[4] )), 'Bundesland' => SOAP::Data->type( string => uri_escape( $items[1] )), 'Firma' => SOAP::Data->type( string => uri_escape( $items[2] )), 'Strasse' => SOAP::Data->type( string => uri_escape( $items[3] )), 'Postleitzahl' => SOAP::Data->type( string => uri_escape( $items[4] )), 'Ort' => SOAP::Data->type( string => uri_escape( $items[1] )), } ); $lineNum++; last if $lineNum > 10; } close IN; return SOAP::Data->type( 'Array') -> name( daten => \@ary ), SOAP::Data->type( 'dateTime' ) -> name( date => $sSystemTime ), ; }1;btw, there must be a better way than uri_escaping all strings; but i haven't yet found or wrote a base64 deserializer for java



          Do You Yahoo!?
          Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
        • Paul Kulchenko
          Hi, Werner! ... You can always combine explicit typing with autotype. autotype only works for values where type is not specified. ... Why do you need to do
          Message 4 of 6 , Nov 23, 2001
          • 0 Attachment
            Hi, Werner!

            --- werner ackerl <cjbecjbe@...> wrote:
            > avoid autotyping whereever possible. java doesn't like being
            > presented an integer when it's expecting a string.
            You can always combine explicit typing with autotype. autotype only
            works for values where type is not specified.

            > => SOAP::Data->type( string => uri_escape( $items[1] )),
            > btw, there must be a better way than uri_escaping all strings;
            Why do you need to do that? If you specify type (string) SOAP::Lite
            will take care about escaping '<', '&' and ']]>'.

            > return SOAP::Data->type( 'Array') -> name( daten =>
            You don't need to specify type for arrays. SOAP::Lite will do that
            base on value (which is array reference). If you do specify Array as
            a type, serializer thinks that it's some custom type 'Array' and put
            it into specific namespace (that's why ApacheSOAP complains). Just
            do:

            SOAP::Data->name(daten => \@ary);

            Hope it helps.

            Best wishes, Paul.

            __________________________________________________
            Do You Yahoo!?
            Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
            http://geocities.yahoo.com/ps/info1
          • werner ackerl
            ... yes, it does. but it doesn t do anything about spacial characters 0x7F, like german umlauts. they seem to work ok on the perl side, but again java is the
            Message 5 of 6 , Nov 27, 2001
            • 0 Attachment
              --- Paul Kulchenko <paulclinger@...> wrote:
              > > btw, there must be a better way than uri_escaping
              > all strings;
              > Why do you need to do that? If you specify type
              > (string) SOAP::Lite
              > will take care about escaping '<', '&' and ']]>'.
              >
              yes, it does. but it doesn't do anything about
              spacial characters > 0x7F, like german umlauts.
              they seem to work ok on the perl side, but again
              java is the problem. if the xml parser gets
              anything with an umlaut inside, it complains
              about not being able to find the next closing tag.
              and if java is asked to put an umlaut into a soap
              message, it puts out two characters. maybe the
              unicode representation of that umlaut.
              > > return SOAP::Data->type( 'Array') ->
              > name( daten =>
              > You don't need to specify type for arrays.
              > SOAP::Lite will do that
              > base on value (which is array reference). If you do
              > specify Array as
              > a type, serializer thinks that it's some custom type
              > 'Array' and put
              > it into specific namespace (that's why ApacheSOAP
              > complains). Just
              > do:
              >
              > SOAP::Data->name(daten => \@ary);
              that works. thanks.
              (strange that my old approach did work with
              0.51 too. was that the bug?)

              __________________________________________________
              Do You Yahoo!?
              Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
              http://geocities.yahoo.com/ps/info1
            • Paul Kulchenko
              Hi, Werner! ... Yes, it doesn t. Details about why and what to do you may find here: http://groups.yahoo.com/group/soaplite/message/904 Code examples are in
              Message 6 of 6 , Nov 27, 2001
              • 0 Attachment
                Hi, Werner!

                --- werner ackerl <cjbecjbe@...> wrote:
                > yes, it does. but it doesn't do anything about
                > spacial characters > 0x7F, like german umlauts.
                Yes, it doesn't. Details about why and what to do you may find here:
                http://groups.yahoo.com/group/soaplite/message/904

                Code examples are in cookbook (http://cookbook.soaplite.com/) or in
                conference materials here: http://conf.soaplite.com/p2p/35.html

                My interoperability tests for special chars don't show any problem
                with Java implementations.

                > that works. thanks.
                > (strange that my old approach did work with
                > 0.51 too. was that the bug?)
                Low-level mechanism for binding classes to namespaces changed. For
                every complex type namespace will be choosen from the hash specified
                as parameter for maptypes(), and for all other types default
                namespace will be used (that's why Array type gets it). Array has
                it's own handling because of number of attributes (like arrayType)
                that other types don't have.

                Best wishes, Paul.

                __________________________________________________
                Do You Yahoo!?
                Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
                http://geocities.yahoo.com/ps/info1
              Your message has been successfully submitted and would be delivered to recipients shortly.