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

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

Expand Messages
  • Ivan Venuti
    ops... I ve done reply and I ve send email to Graham instead of the group, sorry... ...
    Message 1 of 1 , Apr 15, 2005
    • 0 Attachment
      ops... I've done "reply" and I've send email to Graham
      instead of the group, sorry...

      > > This should create the same soap request as the
      > Axis
      > Client.
      >
      > I've modified only some lines (in particular I've
      > sent
      > a date and not a string, in order to match 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;
      > }
      >
      >
      > Unfortunatly I can see that the generated SOAP
      > massage
      > isn't equal to the one generated by Axis; here is
      > the
      > trace of the error:
      >
      >
      >
      > 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://schemas.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:Faul
      >
      t><faultcode>soapenv:Server.userException</faultcode><faultstring>org.xml.sax.SA
      > XException: 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.
      >
      >
      > This is the SOAP message from 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>
      >
      > I think that the problem is inside the body;infact
      > the
      > perl one is:
      >
      >
      > <soap:Body>
      > <productsList
      >
      xmlns="http://ivenuti.altervista.org/ProductsExampleWS.xsd1">
      > <ElementDate
      >
      xsi:type="xsd:date">2005-04-11</ElementDate></productsList>
      > </soap:Body>
      >
      > while the Axis one is without the element
      > productsList:
      >
      > <soapenv:Body>
      > <ElementDate
      >
      xmlns="http://ivenuti.altervista.org/ProductsExampleWS.xsd1">2005-04-14</ElementDate>
      > </soapenv:Body>
      >
      > Is it possible to achieve the same result?
      >
      > Thank a lot for your attention (and patience :) )
      >
      > -- Ivan
      >
      >
      >
      > ___________________________________
      > Nuovo Yahoo! Messenger: E' molto più divertente:
      > Audibles, Avatar, Webcam, Giochi, Rubrica… Scaricalo
      > ora!
      > http://it.messenger.yahoo.it
      >



      ___________________________________
      Nuovo Yahoo! Messenger: E' molto più divertente: Audibles, Avatar, Webcam, Giochi, Rubrica… Scaricalo ora!
      http://it.messenger.yahoo.it
    Your message has been successfully submitted and would be delivered to recipients shortly.