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

New to SOAP::Lite: can't use a WS written in Java with Axis...

Expand Messages
  • Ivan Venuti
    I m new to Perl and I ve written a Web Servis in Java using Axis 1.2Rc3 I ve installed SOAP:Lite (with MIME::Parser 6.01) and I d like to write a Perl client
    Message 1 of 2 , Apr 14, 2005
    • 0 Attachment
      I'm new to Perl and I've written a Web Servis in Java
      using Axis 1.2Rc3
      I've installed SOAP:Lite (with MIME::Parser 6.01) and
      I'd like to write a Perl client for WS described at
      http://www.caribel.it:8080/axis/services/ProductsExampleWSPort?wsdl
      But I'm unable to retrieve any result. Here is my
      code:

      use strict;
      use SOAP::Lite;

      use Data::Dumper;
      my $soap=SOAP::Lite->
      service('http://www.caribel.it:8080/axis/services/ProductsExampleWSPort?wsdl');
      my $val=$soap->productsList('1970-10-12');
      print Dumper($val);

      anyone can help me? Thanks a lot!

      Ivan



      ___________________________________
      Nuovo Yahoo! Messenger: E' molto più divertente: Audibles, Avatar, Webcam, Giochi, Rubrica… Scaricalo ora!
      http://it.messenger.yahoo.it
    • Alex Pena
      Try using trace= all to help debug your client. It looks like you are sending data that is not expected on the server. ... #!/usr/bin/perl -w use warnings;
      Message 2 of 2 , Apr 14, 2005
      • 0 Attachment
        Try using trace=>'all' to help debug your client. It looks like you are
        sending data that is not expected on the server.

        Used the following to test it:
        -----------------------------------------------
        #!/usr/bin/perl -w
        use warnings;
        use SOAP::Lite
        trace=>'all',
        ;

        $proxy =
        'http://www.caribel.it:8080/axis/services/ProductsExampleWSPort';
        $uri = 'ProductsExampleWS';

        #$data = (SOAP::Data->name('lastUpdateDate' => "1970-10-12"));

        $soap = new SOAP::Lite(proxy=>$proxy,uri=>$uri,readable=>'true',);
        $result = $soap->productsList('1970-10-12');

        if ($result->fault){
        print "-----------------------------------------\n";
        print "Fault :", $result->faultstring, "\n";
        print "Faultcode :",$result->faultcode, "\n";
        print "Faultdetail :", %{$result->faultdetail}, "\n";
        } else {
        foreach my $field ($result->valueof("//productsListResponse")) {
        print "\n";
        foreach my $field_name (sort keys %{$field}) {
        print $field_name, ": '",
        $field->{$field_name}, "'\n";
        }
        print "\n";
        }
        }
        ---------------------------------------------
        Also tried it with:
        $data = (SOAP::Data->name('lastUpdateDate' => "1970-10-12"));
        $soap = new SOAP::Lite(proxy=>$proxy,uri=>$uri,readable=>'true',);
        $result = $soap->productsList($data);

        Both returned:
        ------------
        <?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><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>
        ------------

        I'm still a n00b but trace has helped me alot. Good luck.

        Alex,

        On Apr 14, 2005, at 7:11 AM, Ivan Venuti wrote:

        > I'm new to Perl and I've written a Web Servis in Java
        > using Axis 1.2Rc3
        > I've installed SOAP:Lite (with MIME::Parser 6.01) and
        > I'd like to write a Perl client for WS described at
        > http://www.caribel.it:8080/axis/services/ProductsExampleWSPort?wsdl
        > But I'm unable to retrieve any result. Here is my
        > code:
        >
        > use strict;
        > use SOAP::Lite;
        >
        > use Data::Dumper;
        > my $soap=SOAP::Lite->
        >
        > service('http://www.caribel.it:8080/axis/services/
        > ProductsExampleWSPort?wsdl');
        > my $val=$soap->productsList('1970-10-12');
        > print Dumper($val);
        >
        > anyone can help me? Thanks a lot!
        >
        > Ivan
        >
        >
        >            
        > ___________________________________
        > Nuovo Yahoo! Messenger: E' molto più divertente: Audibles, Avatar,
        > Webcam, Giochi, Rubrica… Scaricalo ora!
        > http://it.messenger.yahoo.it
        >
        >
        > Yahoo! Groups Links
        >
        > • To visit your group on the web, go to:
        > http://groups.yahoo.com/group/soaplite/
        >  
        > • To unsubscribe from this group, send an email to:
        > soaplite-unsubscribe@yahoogroups.com
        >  
        > • Your use of Yahoo! Groups is subject to the Yahoo! Terms of
        > Service.
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.