You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Hi...@sybase.com on 2003/04/09 22:53:39 UTC
Axis Client accessing EAServer webservice
Hello, I'm having problems with an Apache Axis client accessing a simple
EAServer webservice. The webservice is an EJB with a method, int foo(int
p0), that returns p0*p0.
My axis client sends the following SOAP message to EAServer:
POST /WEBSERVICES/SOAP HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.0
Host: hishama-pc:8080
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: "Test/Ex1.foo return,int,return in,int,p0"
Content-Length: 463
<?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>
<ns1:foo soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/
" xmlns:ns1="file://C:\webservicetest\proxy\Ex1ServiceCompl.wsdl">
<ns1:p0 xsi:type="xsd:int">5</ns1:p0>
</ns1:foo>
</soapenv:Body>
</soapenv:Envelope>
EAServer however, gives it the following fault:
HTTP/1.1 200 OK
Server: Jaguar Server Version 4.2
Connection: Close
Content-Type: text/xml; charset=utf-8
Content-Length: 653
<SOAP-ENV:Envelope xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="
http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="
http://www.w3.org/2001/XMLSchema/instance" xmlns:xsd="
http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/" >
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>SOAP Client Error</faultstring>
<detail>
<fd:faultdetail xmlns:fd="Test/Ex1.foo" >
<message>
Parameter name "p0" does not match expected name "ns1:p0".
</message>
</fd:faultdetail>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
It seems that EAServer does not like the namespace ns1 attached to p0. If
I replace
<ns1:p0 xsi:type="xsd:int">5</ns1:p0> with <p0 xsi:type="xsd:int">5</p0> or
remove the alias ns1 totally
then EAServer returns the correct response.
I think the xml that Axis sends is acceptable, so is this a bug with
EAServer? Is there a way to tell Axis to not add the ns1 namespace? i.e.
send
<foo soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<p0 xsi:type="xsd:int">5</p0>
</foo>
instead, just like how my .NET client does.
The following is my wsdl file as well if it's of any help:
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions name="Ex1Service" targetNamespace="file://C:
\webservicetest\proxy\Ex1ServiceCompl.wsdl"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tnsi="file://C:\webservicetest\proxy\Ex1ServiceCompl.wsdl"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:message name="fooOutput">
<wsdl:part name="return" type="xsd:int"/>
</wsdl:message>
<wsdl:message name="fooInput">
<wsdl:part name="p0" type="xsd:int"/>
</wsdl:message>
<wsdl:portType name="Test/Ex1ServicePortType">
<wsdl:operation name="foo" parameterOrder="p0">
<wsdl:input name="fooInput" message="tnsi:fooInput"/>
<wsdl:output name="fooOutput" message="tnsi:fooOutput"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="Test/Ex1ServiceBinding" type
="tnsi:Test/Ex1ServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="rpc"/>
<wsdl:operation name="foo">
<wsdl:input name="fooInput">
<soap:body encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>
</wsdl:input>
<wsdl:output name="fooOutput">
<soap:body encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/" use="encoded"/>
</wsdl:output>
<soap:operation soapAction="Test/Ex1.foo return,int,return
in,int,p0" style="rpc"/>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Test/Ex1Service">
<wsdl:port name="Test/Ex1ServicePort" binding
="tnsi:Test/Ex1ServiceBinding">
<soap:address location="http://hishama-pc:8080/WEBSERVICES/SOAP
"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Thank you for your help,
Hisham