|
Hi everyone, I am new to AXIS2 and have a question of correctly invoking the
service. I developed an asynchronous web service and built an archive file to
be deployed on my local server. There’s no error during deploying. I
attached the wsdl file. The following is the code I try to invoke the service: public class Test { /** *
@param args */ public
static void main(String[] args) throws Exception{ AnalysisMethod1Stub
reqComputing = new AnalysisMethod1Stub(); ReceiveRequest
rr = new ReceiveRequest(); OMFactory
factory = OMAbstractFactory.getOMFactory(); OMNamespace
ns =
factory.createOMNamespace("http://AnalysisMethod1.analysis.earlylife.org/types",
"ns1"); OMElement
job = factory.createOMElement("job", ns); job.addAttribute("status",
"request", ns); rr.setJob(job); AnalysisMethod1CallbackHandler
callback = new AnalysisMethod1CallbackHandler(null){ public
void receiveResultreceiveRequest(
org.earlylife.analysis.analysismethod1.types.ReceiveRequestResponse param27) { System.out.println(param27.getReceived_job().getLocalName()); } public
void receiveErrorreceiveRequest(java.lang.Exception e) { e.printStackTrace();
} }; reqComputing.startreceiveRequest(rr,
callback); Thread.sleep(3000); } } The errors are displayed as: java.lang.Exception: org.apache.axis2.AxisFault: java.lang.RuntimeException: Unexpected subelement job; nested
exception is: java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement job at
org.apache.axis2.AxisFault.makeFault(AxisFault.java:318) at
org.earlylife.analysis.analysismethod1.AnalysisMethod1MessageReceiverInOut.invokeBusinessLogic(AnalysisMethod1MessageReceiverInOut.java:75) at
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:37) at
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:454) at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:284) at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:136) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at
java.lang.Thread.run(Thread.java:595) Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement job at
org.earlylife.analysis.analysismethod1.AnalysisMethod1MessageReceiverInOut.fromOM(AnalysisMethod1MessageReceiverInOut.java:243) at
org.earlylife.analysis.analysismethod1.AnalysisMethod1MessageReceiverInOut.invokeBusinessLogic(AnalysisMethod1MessageReceiverInOut.java:66) ... 20 more Caused by: java.lang.RuntimeException: Unexpected subelement job at
org.earlylife.analysis.analysismethod1.types.ReceiveRequest$Factory.parse(ReceiveRequest.java:126) at
org.earlylife.analysis.analysismethod1.AnalysisMethod1MessageReceiverInOut.fromOM(AnalysisMethod1MessageReceiverInOut.java:230) ... 21 more at
org.apache.axiom.soap.impl.llom.SOAPFaultImpl.getException(SOAPFaultImpl.java:153) at org.apache.axis2.description.OutInAxisOperationClient$NonBlockingInvocationWorker.run(OutInAxisOperation.java:417) at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at
java.lang.Thread.run(Unknown Source) Can someone tell me how to correctly invoke my service
please? Or are there any problems with my wsdl file? Thanks a lot. Sally |
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="http://AnalysisMethod1.analysis.earlylife.org/types" xmlns:ns="http://AnalysisMethod1.analysis.earlylife.org" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://AnalysisMethod1.analysis.earlylife.org"><wsdl:types><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:types="http://AnalysisMethod1.analysis.earlylife.org/types" xmlns:stn_3="http://analysis.earlylife.org/xsd" targetNamespace="http://AnalysisMethod1.analysis.earlylife.org/types" elementFormDefault="unqualified" attributeFormDefault="unqualified"> <xs:import namespace="http://analysis.earlylife.org/xsd" /> <xs:element type="ns1:Job" name="Job" /> <xs:complexType name="Job"> <xs:sequence> <xs:element type="stn_3:AnalysisMethod" name="method" /> <xs:element type="xs:string" name="status" /> <xs:element type="xs:string" name="userName" /> <xs:element type="xs:string" name="caseName" /> <xs:element type="xs:dateTime" name="requestTime" /> </xs:sequence> </xs:complexType> <xs:element type="ns1:AnalysisMethod" name="AnalysisMethod" /> <xs:complexType name="AnalysisMethod"> <xs:sequence> <xs:element type="xs:string" name="name" /> <xs:element type="xs:string" name="version" /> </xs:sequence> </xs:complexType> <xs:element name="receiveRequest"> <xs:complexType> <xs:sequence> <xs:element type="stn_3:Job" name="job" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="receiveRequestResponse"> <xs:complexType> <xs:sequence> <xs:element type="stn_3:Job" name="received_job" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="doAnalysis"> <xs:complexType> <xs:sequence> <xs:element type="stn_3:Job" name="job" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="doAnalysisResponse"> <xs:complexType> <xs:sequence> <xs:element type="stn_3:Job" name="executing_job" /> </xs:sequence> </xs:complexType> </xs:element> </xs:schema></wsdl:types><wsdl:message name="doAnalysisMessage"><wsdl:part element="ns1:doAnalysis" name="part1" /></wsdl:message><wsdl:message name="doAnalysisResponseMessage"><wsdl:part element="ns1:doAnalysisResponse" name="part1" /></wsdl:message><wsdl:message name="receiveRequestMessage"><wsdl:part element="ns1:receiveRequest" name="part1" /></wsdl:message><wsdl:message name="receiveRequestResponseMessage"><wsdl:part element="ns1:receiveRequestResponse" name="part1" /></wsdl:message><wsdl:portType name="AnalysisMethod1PortType"><wsdl:operation name="doAnalysis"><wsdl:input message="ns:doAnalysisMessage" /><wsdl:output message="ns:doAnalysisResponseMessage" /></wsdl:operation><wsdl:operation name="receiveRequest"><wsdl:input message="ns:receiveRequestMessage" /><wsdl:output message="ns:receiveRequestResponseMessage" /></wsdl:operation></wsdl:portType><wsdl:binding type="ns:AnalysisMethod1PortType" name="AnalysisMethod1SOAP11Binding"><soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /><wsdl:operation name="doAnalysis"><soap:operation style="document" soapAction="urn:doAnalysis" /><wsdl:input><soap:body namespace="http://AnalysisMethod1.analysis.earlylife.org" use="literal" /></wsdl:input><wsdl:output><soap:body namespace="http://AnalysisMethod1.analysis.earlylife.org" use="literal" /></wsdl:output></wsdl:operation><wsdl:operation name="receiveRequest"><soap:operation style="document" soapAction="urn:receiveRequest" /><wsdl:input><soap:body namespace="http://AnalysisMethod1.analysis.earlylife.org" use="literal" /></wsdl:input><wsdl:output><soap:body namespace="http://AnalysisMethod1.analysis.earlylife.org" use="literal" /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding type="ns:AnalysisMethod1PortType" name="AnalysisMethod1SOAP12Binding"><soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /><wsdl:operation name="doAnalysis"><soap12:operation style="document" soapAction="urn:doAnalysis" /><wsdl:input><soap12:body namespace="http://AnalysisMethod1.analysis.earlylife.org" use="literal" /></wsdl:input><wsdl:output><soap12:body namespace="http://AnalysisMethod1.analysis.earlylife.org" use="literal" /></wsdl:output></wsdl:operation><wsdl:operation name="receiveRequest"><soap12:operation style="document" soapAction="urn:receiveRequest" /><wsdl:input><soap12:body namespace="http://AnalysisMethod1.analysis.earlylife.org" use="literal" /></wsdl:input><wsdl:output><soap12:body namespace="http://AnalysisMethod1.analysis.earlylife.org" use="literal" /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding type="ns:AnalysisMethod1PortType" name="AnalysisMethod1HttpBinding"><http:binding verb="POST" /><wsdl:operation name="doAnalysis"><http:operation location="doAnalysis" /><wsdl:input><mime:content type="text/xml" /></wsdl:input><wsdl:output><mime:content type="text/xml" /></wsdl:output></wsdl:operation><wsdl:operation name="receiveRequest"><http:operation location="receiveRequest" /><wsdl:input><mime:content type="text/xml" /></wsdl:input><wsdl:output><mime:content type="text/xml" /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service name="AnalysisMethod1"><wsdl:port binding="ns:AnalysisMethod1SOAP11Binding" name="AnalysisMethod1SOAP11port0"><soap:address location="http://localhost:8080/axis2/services/AnalysisMethod1" /></wsdl:port><wsdl:port binding="ns:AnalysisMethod1SOAP12Binding" name="AnalysisMethod1SOAP12port0"><soap12:address location="http://localhost:8080/axis2/services/AnalysisMethod1" /></wsdl:port><wsdl:port binding="ns:AnalysisMethod1HttpBinding" name="AnalysisMethod1Httpport0"><http:address location="http://localhost:8080/axis2/rest/AnalysisMethod1" /></wsdl:port></wsdl:service></wsdl:definitions>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
