Skip to Content
0
May 22, 2006 at 08:10 AM

Calling WebService: "Incorrect request style parameter"

33 Views

Hi,

I have a web service deployed on WAS 6.40, which runs all right when I use the Web Services Navigator. However, when I try to use Axis to call it from a client, it just gives me an HTML page as return, where the error message says:

"Incorrect request style parameter value null."

The web service basically has a method "notify", which takes a String targetId and a Boolean available and returns a String.

The request that goes out with the test client in Web Service Navigator is:

POST /Notifier/Default?style=document HTTP/1.1

Host: drsd00146894a:50000

Content-Type: text/xml; charset="UTF-8"

Connection: close

Content-Length: 560

SOAPAction: ""

http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns:xs=" http://www.w3.org/2001/XMLSchema"> xmlns:sapsess=" true http://www.sap.com/webas/630/soap/features/session/"> true xmlns:pns='urn:NotifierVi'> test false

With Axis, I do the following:

String endpoint =

"http://drsd00146894a:50000/Notifier/Default";

Service service = new Service();

Call call = (Call) service.createCall();

call.setTargetEndpointAddress( new java.net.URL(endpoint) );

call.setOperationName(new QName("urn:NotifierVi", "notify"));

call.addParameter(new QName("urn:NotifierVi","targetId"), org.apache.axis.encoding.XMLType.XSD_STRING, ParameterMode.IN);

call.addParameter(new QName("urn:NotifierVi","available"), org.apache.axis.encoding.XMLType.XSD_BOOLEAN, ParameterMode.IN);

call.setReturnType( org.apache.axis.encoding.XMLType.XSD_STRING );

Object myParams[] = new Object[2];

myParams[0]="uuid:CorePac";

myParams[1]=new Boolean(true);

call.invoke( myParams );

Now, I listened for the SOAP message that goes out on the wire, and there it says the following:

POST /Notifier/Default HTTP/1.0

Content-Type: text/xml; charset=utf-8

Accept: application/soap+xml, application/dime, multipart/related, text/*

User-Agent: Axis/1.3

Host: 127.0.0.1:50000

Cache-Control: no-cache

Pragma: no-cache

SOAPAction: ""

Content-Length: 668

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

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>

http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:NotifierVi">

<ns1:targetId xsi:type="xsd:string">uuid:CorePac</ns1:targetId>

<ns1:available href="#id0"/>

</ns1:notify>

http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:boolean" xmlns:soapenc=" truehttp://schemas.xmlsoap.org/soap/encoding/">true>

</soapenv:Body>

</soapenv:Envelope>

Now, what is wrong with that one? I can't really see where there are request parameters are missing..

Any hint as to where I'm going wrong would be greatly appreciated..

Regards,

Katrin.