problem perl SOAP::Lite 0.71 client with java JAX-WS 2.1.2 server

  I am creating and using web services for long. Until now I created java and php service clients and server, but now I had to create a client in perl to maintain relationship betweend the old perl system with a new java system. The java and php servers and clients wrok without any problem, but I am unable to make perl client work.

The perl client is very simple, the code is attached. The server works fine with java client. The perl and java generated requests are quite similar. The mentionable difference in namespaces. The perl client calls the procedure but parameters looks not received properly by the server and it causes null pointer exception because of lack of parameters. It drives me crazy. Do you have any ide what is the cause and how to solve it?

Service WSDL:

<?xml version="1.0" encoding="UTF-8"?><!-- Published by JAX-WS RI at RI's version is JAX-WS RI 2.1.2-b05-RC1. --><!-- Generated by JAX-WS RI at RI's version is JAX-WS RI 2.1.2-b05-RC1. --><definitions xmlns:soap="" xmlns:tns="" xmlns:xsd="" xmlns="" targetNamespace="" name="OsszeadService">
<xsd:import namespace="" schemaLocation=""></xsd:import>
<message name="plusz">
<part name="parameters" element="tns:plusz"></part>
<message name="pluszResponse">
<part name="parameters" element="tns:pluszResponse"></part>
<portType name="Osszead">
<operation name="plusz">
<input message="tns:plusz"></input>
<output message="tns:pluszResponse"></output>
<binding name="OsszeadPortBinding" type="tns:Osszead">
<soap:binding transport="" style="document"></soap:binding>
<operation name="plusz">
<soap:operation soapAction=""></soap:operation>
<soap:body use="literal"></soap:body>
<soap:body use="literal"></soap:body>
<service name="OsszeadService">
<port name="OsszeadPort" binding="tns:OsszeadPortBinding">
<soap:address location=""></soap:address>

Open in new window

perl client trace:

[root@bck ~]# ./
SOAP::Transport::new: ()
SOAP::Serializer::new: ()
SOAP::Deserializer::new: ()
SOAP::Parser::new: ()
SOAP::Lite::new: ()
SOAP::Transport::HTTP::Client::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Lite::call: ()
SOAP::Serializer::envelope: ()
SOAP::Serializer::envelope: plusz SOAP::Data=HASH(0x9091248) SOAP::Data=HASH(0x90912f0)
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Data::new: ()
SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x90995bc)
SOAP::Transport::HTTP::Client::send_receive: POST HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 507
Content-Type: text/xml; charset=utf-8
SOAPAction: ""

<?xml version="1.0" encoding="UTF-8"?>
    <plusz xmlns="">

SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x945b094)
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error
Connection: close
Date: Sun, 15 Aug 2010 11:05:30 GMT
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Client-Date: Sun, 15 Aug 2010 11:05:30 GMT
Client-Response-Num: 1

<?xml version="1.0" ?><S:Envelope xmlns:S=""><S:Body><ns2:Fault xmlns:ns2="" xmlns:ns3=""><faultcode>ns2:Server</faultcode><faultstring>java.lang.NullPointerException</faultstring><detail><ns2:exception xmlns:ns2="" class="java.lang.NullPointerException" note="To disable this feature, set system property to false"><ns2:stackTrace><ns2:frame class="hu.fooly.test.osszead.Osszead" file="" line="28" method="plusz"/><ns2:frame class="sun.reflect.GeneratedMethodAccessor989" line="unknown" method="invoke"/><ns2:frame class="sun.reflect.DelegatingMethodAccessorImpl" file="" line="25" method="invoke"/><ns2:frame class="java.lang.reflect.Method" file="" line="597" method="invoke"/><ns2:frame class="$1" file="" line="246" method="invoke"/><ns2:frame class="$2" file="" line="146" method="invoke"/><ns2:frame class="" file="" line="257" method="invoke"/><ns2:frame class="" file="" line="93" method="processRequest"/><ns2:frame class="" file="" line="595" method="__doRun"/><ns2:frame class="" file="" line="554" method="_doRun"/><ns2:frame class="" file="" line="539" method="doRun"/><ns2:frame class="" file="" line="436" method="runSync"/><ns2:frame class="$2" file="" line="243" method="process"/><ns2:frame class="$HttpToolkit" file="" line="444" method="handle"/><ns2:frame class="" file="" line="244" method="handle"/><ns2:frame class="" file="" line="135" method="handle"/><ns2:frame class="" file="" line="129" method="doGet"/><ns2:frame class="" file="" line="160" method="doPost"/><ns2:frame class="" file="" line="75" method="doPost"/><ns2:frame class="javax.servlet.http.HttpServlet" file="" line="710" method="service"/><ns2:frame class="javax.servlet.http.HttpServlet" file="" line="803" method="service"/><ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="" line="290" method="internalDoFilter"/><ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="" line="206" method="doFilter"/><ns2:frame class="org.apache.catalina.core.StandardWrapperValve" file="" line="233" method="invoke"/><ns2:frame class="org.apache.catalina.core.StandardContextValve" file="" line="175" method="invoke"/><ns2:frame class="org.apache.catalina.core.StandardHostValve" file="" line="128" method="invoke"/><ns2:frame class="org.apache.catalina.valves.ErrorReportValve" file="" line="102" method="invoke"/><ns2:frame class="org.apache.catalina.core.StandardEngineValve" file="" line="109" method="invoke"/><ns2:frame class="org.apache.catalina.connector.CoyoteAdapter" file="" line="286" method="service"/><ns2:frame class="org.apache.coyote.http11.Http11Processor" file="" line="844" method="process"/><ns2:frame class="org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler" file="" line="583" method="process"/><ns2:frame class="$Worker" file="" line="447" method="run"/><ns2:frame class="java.lang.Thread" file="" line="619" method="run"/></ns2:stackTrace></ns2:exception></detail></ns2:Fault></S:Body></S:Envelope>
SOAP::Deserializer::deserialize: ()
SOAP::Parser::decode: ()
SOAP::SOM::new: ()
SOAP::Deserializer::DESTROY: ()
SOAP::Parser::DESTROY: ()
SOAP::Serializer::DESTROY: ()
SOAP::Transport::DESTROY: ()
SOAP::Transport::HTTP::Client::DESTROY: ()
[root@bck ~]#

Open in new window

Java client request and response:

POST /TestWS001/OsszeadService HTTP/1.1
Content-type: text/xml;charset=utf-8
Soapaction: ""
Accept: text/xml, multipart/related
User-Agent: JAX-WS RI 2.2-hudson-752-
Cache-Control: no-cache
Pragma: no-cache
Connection: keep-alive
Content-Length: 226

<?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S=""><S:Body><ns2:plusz xmlns:ns2=""><arg0>8</arg0><arg1>91</arg1></ns2:plusz></S:Body></S:Envelope>

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Fri, 13 Aug 2010 11:49:52 GMT

<?xml version="1.0" ?><S:Envelope xmlns:S=""><S:Body><ns2:pluszResponse xmlns:ns2=""><return>99</return></ns2:pluszResponse></S:Body></S:Envelope>

Open in new window

#!/usr/bin/perl -w
use utf8;
use strict;

use SOAP::Lite +trace => 'all';

my $host  = '';
my $uri   = '';
my $proxy = $host . '/TestWS001/OsszeadService';

my $soap = SOAP::Lite->uri($uri)->proxy($proxy);

print $soap->call('plusz', SOAP::Data->name("arg0")->value(1)->type(''),SOAP::Data->name("arg1")->value(2)->type('') )->result;

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

your only difference is that plusz is not prefixed, <plusz xmlns=""> [perl]
 versus <ns2:plusz xmlns:ns2=""> [java]

This is a known bug in java sax parsers:

I think that you could prefix the element if you create a custom soap serializer.
my $soap = SOAP::Lite->uri($uri)->proxy($proxy);
$soap->ns('', 'ns2'); # this might do the trick ...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.