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

4581Re: [soaplite] Re: New to SOAP:Lite: Can't use a WS written in Java with Axis...

Expand Messages
  • Ivan Venuti
    Apr 15, 2005
    • 0 Attachment
      My forwarded message seems to be quite difficult to
      read! here is a re-post much more easy to read.

      First of all seems that the generated SOAP message is
      still unreadable by Axis; this is the message
      generated by Perl:

      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope
      soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
      <productsList
      xmlns="http://ivenuti.altervista.org/ProductsExampleWS.xsd1">
      <ElementDate
      xsi:type="xsd:date">2005-04-11</ElementDate>
      </productsList>
      </soap:Body>
      </soap:Envelope>

      This one is generated by the Axis client:

      <?xml version="1.0" encoding="utf-8"?>
      <soapenv:Envelope

      xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body>
      <ElementDate
      xmlns="http://ivenuti.altervista.org/ProductsExampleWS.xsd1">2005-04-14</ElementDate>
      </soapenv:Body>
      </soapenv:Envelope>

      They are quite similar but the second one hasn’t the
      element <productsList ..> in the SOAP:Body.

      The code, originated from the code given in the list
      but with some corrections (e.g. made a date and not a
      string in order to achieve the xsd type):

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

      # Your Variables - set accordingly
      my
      $proxy='http://www.caribel.it:8080/axis/services/ProductsExampleWSPort?wsdl';
      my
      $uri='http://ivenuti.altervista.org/ProductsExampleWS.xsd1';
      my $date = "2005-04-11";

      my $soap = SOAP::Lite
      ->uri($uri)
      ->on_action( sub {join '/',$uri,$_[1]} )
      ->proxy($proxy);

      my
      $method=SOAP::Data->name('productsList')->attr({xmlns
      => $uri});

      my @params;

      my $request=
      SOAP::Data->name('ElementDate')->value($date)->type('date');

      push @params,$request;

      my $result = $soap->call($method => @params);

      if ($result->fault){
      print $result->faultstring;
      }
      else{
      print $result->result;
      }

      The error trace is quite similar to the previous one:


      SOAP::Transport::HTTP::Client::send_receive: POST
      http://www.caribel.it:8080/axi
      s/services/ProductsExampleWSPort?wsdl HTTP/1.1
      Accept: text/xml
      Accept: multipart/*
      Accept: application/soap
      Content-Length: 514
      Content-Type: text/xml; charset=utf-8
      SOAPAction:
      http://ivenuti.altervista.org/ProductsExampleWS.xsd1/productsList

      <?xml version="1.0" encoding="UTF-8"?><soap:Envelope
      xmlns:xsi="http://www.w3.or
      g/2001/XMLSchema-instance"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encodi
      ng/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      soap:encodingStyle="http://sch
      emas.xmlsoap.org/soap/encoding/"
      xmlns:soap="http://schemas.xmlsoap.org/soap/env
      elope/"><soap:Body><productsList
      xmlns="http://ivenuti.altervista.org/ProductsEx
      ampleWS.xsd1"><ElementDate
      xsi:type="xsd:date">2005-04-11</ElementDate></product
      sList></soap:Body></soap:Envelope>
      SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1
      500 Internal
      Server Error
      Connection: close
      Date: Fri, 15 Apr 2005 16:08:02 GMT
      Server: Apache-Coyote/1.1
      Content-Type: text/xml;charset=utf-8
      Client-Date: Fri, 15 Apr 2005 16:06:42 GMT
      Client-Peer: 151.4.110.70:8080
      Client-Response-Num: 1

      <?xml version="1.0"
      encoding="utf-8"?><soapenv:Envelope
      xmlns:soapenv="http://sc
      hemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema" x
      mlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body><soapenv:Fault>
      <faultcode>soapenv:Server.userException</faultcode>
      <faultstring>org.xml.sax.SAXException:
      SimpleDeserializer encountered a child element, which
      is NOT expected, in something it was trying to
      deserialize.</faultstring>
      <detail><ns1:hostname
      xmlns:ns1="http://xml.apache.org/axis/">alpha</ns1:hostname></detail></soapenv:
      Fault></soapenv:Body></soapenv:Envelope>
      org.xml.sax.SAXException: SimpleDeserializer
      encountered a child
      element, which
      is NOT expected, in something it was trying to
      deserialize.




      ___________________________________
      Nuovo Yahoo! Messenger: E' molto più divertente: Audibles, Avatar, Webcam, Giochi, Rubrica… Scaricalo ora!
      http://it.messenger.yahoo.it
    • Show all 7 messages in this topic