Hi all,
I recently started studying json based webservices and followed your tutorial on helloworld. But when I call my webserive using a client it generates an error on tomcat :
"SEVERE: Couldn't create SOAP message due to exception: com.jaxws.json.codec.JSONFault: Failed to create message body.More than one operation found
com.sun.xml.ws.protocol.soap.MessageCreationException: Couldn't create SOAP message due to exception: com.jaxws.json.codec.JSONFault: Failed to create message body.More than one operation found
at com.jaxws.json.codec.JSONCodec.throwMessageCreationException(JSONCodec.java:541)
at com.jaxws.json.codec.JSONCodec.decode(JSONCodec.java:514)
at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:276)
...
Caused by: com.jaxws.json.codec.JSONFault: Failed to create message body.More than one operation found
at com.jaxws.json.codec.decode.FormDecoder.getFormData(FormDecoder.java:177)
at com.jaxws.json.codec.decode.FormDecoder.getWSMessage(FormDecoder.java:84)
at com.jaxws.json.codec.JSONCodec.decode(JSONCodec.java:508)
... 26 more
Caused by: java.lang.RuntimeException: More than one operation found
at com.jaxws.json.codec.decode.FormDecoder.getFormData(FormDecoder.java:174)
... 28 more"
The json message im sending from the client is:
Using:"
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
conn.setInstanceFollowRedirects(true);
conn.setRequestMethod("POST");
conn.setDoInput(true);
conn.setDoOutput(true);
//just to test webservice
String jsonMessage = " {\"auth\":{ \"email\": \"
john...@example.com\", \"password\": \"605b32dd\"}}";
DataOutputStream output = new DataOutputStream( conn.getOutputStream() );
output.write( jsonMessage.getBytes("UTF-8") );
System.out.println("request message:" + jsonMessage);
output.flush();
output.close();
resp_code = conn.getResponseCode();
"
The webservice is:
"
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class Authenticate {
@WebMethod(operationName = "auth")
public @WebResult(name="message") String auth(
@WebParam(name="email") String email, @WebParam(name="password") String password){
...
}
"
Can you guys help me out? do you need more info? Thanks alot ;)