Greetings,
I have been trying to run a j2me application using ksoap2 to access a web service. Thus far I have been unable to do so, due to some error in the call I am making to the service. I was wondering if anyone could spot what I have done wrong in the call:
This is the expected soap body for the web service:
<authenticateUser xmlns="http://www.openuri.org/">
<!--Optional:-->
<info>
<!--Optional:-->
<userID>test</userID>
<!--Optional:-->
<password>password</password>
<resultCode>3</resultCode>
<!--Optional:-->
<message>string</message>
</info>
</authenticateUser>
This is the code I am using to call the web service from the midlet:
SoapObject rpc = new SoapObject("http://localhost:7001/BasicAppWeb/MyWebServices","authenticateUser");
rpc.addProperty("info", info);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER10);
envelope.bodyOut = rpc;
HttpTransport ht = new HttpTransport("http://localhost:7001/BasicAppWeb/MyWebServices/AuthenticationService.jws");
This is the response (error) I am receiving from the server:
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode xmlns:fc='http://www.bea.com/2003/04/jwFaultCode/'>fc:JWSError</faultcode>
<faultstring>
Could not resolve method with element 'http://localhost:7001/BasicAppWeb/MyWebServices:authenticateUser' as top element.
</faultstring>
<detail>
<jwErr:jwErrorDetail xmlns:jwErr='http://www.bea.com/2002/04/jwErrorDetail/'>
com.bea.wlw.runtime.core.request.RequestValidationException: Could not resolve method with element 'http://localhost:7001/BasicAppWeb/MyWebServices:authenticateUser' as top element. [ServiceException]
at com.bea.wlw.runtime.jws.request.SoapResponse.processException(SoapResponse.java:194)
at com.bea.wlw.runtime.core.request.BaseResponse.setFault(BaseResponse.java:23)
at com.bea.wlw.runtime.core.bean.SyncDispatcherBean.invoke(SyncDispatcherBean.java:218)
at …………………………………
…………..more errors…………..
</jwErr:jwErrorDetail>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
This is how my message is being formatted:
<v:Envelope xmlns:i="http://www.w3.org/1999/XMLSchema-instance" xmlns:d="http://www.w3.org/1999/XMLSchema" xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/">
<v:Header />
<v:Body>
<n0:authenticateUser id="o0" c:root="1" xmlns:n0="http://localhost:7001/BasicAppWeb/MyWebServices">
<info i:type=":AuthInfo">
<userID i:type="d:string">test</userID>
<password i:type="d:string">password</password>
</info>
</n0:authenticateUser>
</v:Body>
</v:Envelope>
Thanks in advance for any help, I have been struggling with this one for a bit.
Thanks!
Marcos

Reply With Quote
pe="http://www.openuri.org/">
art name="parameters" element="s0:authenticateUser"/>

