Reputation: 11701
I'm trying to call a web-service of opentaps from eclipse in java. I have the code
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL("url"));
call.setOperationName(new QName("quickCreateCustomer", "quickCreateCustomer"));
call.addParameter("emailAddress", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
call.addParameter("firstName", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
call.addParameter("lastName", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
call.addParameter("login.password", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
call.addParameter("login.username", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
call.setReturnType(org.apache.axis.Constants.XSD_STRING);
Object responseWS = call.invoke(new Object[] { "mail_id", "s", "h", "pwd", "user_name" });
System.out.println("ReceivingResponse: " + (String) responseWS);
output = call.getOutputParams();
but its giving run-time error,
- Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
- Exception:
org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2448)
at org.apache.axis.client.Call.invoke(Call.java:2347)
at org.apache.axis.client.Call.invoke(Call.java:1804)
at TriongleJava.main(TriongleJava.java:36)
org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
on the line
Object responseWS = call.invoke(new Object[] { "mail_id", "s", "h", "pwd", "user_name" });
As I'm new to Java, I don't know how to remove it and even I don't know cause of the error.
Upvotes: 0
Views: 16697
Reputation: 21
Our team faced the same error while accessing webservices using axis 1.4.1 and issue was due to a higher version of JRE ie JRE 1.6.0_37.While using JRE 1.6.0 it started working in both Eclipse java project & Jetty web app.
Cheers, Nisanth
Upvotes: 2
Reputation: 6254
Seems like you're missing a runtime dependency on the JavaMail package (mail.jar
and activation.jar
).
Upvotes: 1