[jboss-user] [JBossWS] - Re: Web Service client side

abdujaparov do-not-reply at jboss.com
Fri Nov 2 04:54:50 EDT 2007


Hi  I've tryed to write this client but it doesn't work:


  | import javax.xml.namespace.QName;
  | import javax.xml.rpc.Call;
  | import javax.xml.rpc.ParameterMode;
  | import javax.xml.rpc.Service;
  | import javax.xml.rpc.ServiceException;
  | import javax.xml.rpc.ServiceFactory;
  | import javax.xml.rpc.encoding.XMLType;
  | 
  | public class ClientProva {
  | 
  | public static void main(String[] args) throws ServiceException, RemoteException{
  | 
  | QName serviceName = new QName("Tesi");
  | 		ServiceFactory factory = ServiceFactory.newInstance();
  |         Service service = factory.createService(serviceName);
  |         
  |         Call call = service.createCall();
  |         call.setTargetEndpointAddress("http://localhost:8080/Tesi/services/port");
  |         QName operationName = new QName("getNumberOfRequest");
  |         call.setOperationName(operationName);
  |         call.addParameter(
  |                 "arg0",             // parameter name
  |                 XMLType.XSD_STRING, // parameter XML type QName
  |                 String.class,       // parameter Java type class
  |                 ParameterMode.IN);  // parameter mode
  |         call.setReturnType(XMLType.XSD_INT);
  |         call.setProperty(
  |                 Call.OPERATION_STYLE_PROPERTY,
  |                 "wrapped");
  |         Object[] actualArgs = {"fattoriale"};
  |         Integer response = (Integer) call.invoke(actualArgs);
  |         System.out.println("response = " + response);
  | }
  | }
  | 

I've ONLY service name, operation name and endpoint address.
When I run the client jboss give me this output:

  | 11:21:24,850 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
  | org.jboss.ws.core.CommonSOAPFaultException: Endpoint {http://tesi/}TesiPort does
  |  not contain operation meta data for: getNumberOfRequest
  |         at org.jboss.ws.core.server.ServiceEndpointInvoker.getDispatchDestinatio
  | n(ServiceEndpointInvoker.java:457)
  |         at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpoin
  | tInvoker.java:176)
  |         at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHan
  | dlerImpl.java:408)
  |         at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHand
  | lerImpl.java:272)
  |         at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl
  | .java:189)
  |         at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(Request
  | HandlerImpl.java:122)
  |         at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java
  | :84)
  |         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
  | icationFilterChain.java:290)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
  | ilterChain.java:206)
  |         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
  | lter.java:96)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
  | icationFilterChain.java:235)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
  | ilterChain.java:206)
  |         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
  | alve.java:230)
  |         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
  | alve.java:175)
  |         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
  | yAssociationValve.java:179)
  |         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
  | e.java:84)
  |         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
  | ava:128)
  |         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
  | ava:104)
  |         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC
  | onnectionValve.java:157)
  |         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
  | ve.java:109)
  |         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
  | a:241)
  |         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
  | :844)
  |         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
  | ss(Http11Protocol.java:580)
  |         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
  | 7)
  |         at java.lang.Thread.run(Thread.java:595)
  | 11:21:24,888 ERROR [SOAPFaultHelperJAXRPC] SOAP request exception
  | javax.xml.rpc.soap.SOAPFaultException: Endpoint {http://tesi/}TesiPort does not
  | contain operation meta data for: getNumberOfRequest
  |         at org.jboss.ws.core.jaxrpc.SOAPFaultHelperJAXRPC.exceptionToFaultMessag
  | e(SOAPFaultHelperJAXRPC.java:189)
  |         at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.exceptionToFaultMessage(
  | SOAPFaultHelperJAXWS.java:157)
  |         at org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS.createFaultMessage
  | FromException(SOAP11BindingJAXWS.java:104)
  |         at org.jboss.ws.core.CommonSOAPBinding.bindFaultMessage(CommonSOAPBindin
  | g.java:645)
  |         at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpoin
  | tInvoker.java:277)
  |         at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHan
  | dlerImpl.java:408)
  |         at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHand
  | lerImpl.java:272)
  |         at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl
  | .java:189)
  |         at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(Request
  | HandlerImpl.java:122)
  |         at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java
  | :84)
  |         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
  | icationFilterChain.java:290)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
  | ilterChain.java:206)
  |         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
  | lter.java:96)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
  | icationFilterChain.java:235)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
  | ilterChain.java:206)
  |         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
  | alve.java:230)
  |         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
  | alve.java:175)
  |         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
  | yAssociationValve.java:179)
  |         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
  | e.java:84)
  |         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
  | ava:128)
  |         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
  | ava:104)
  |         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC
  | onnectionValve.java:157)
  |         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
  | ve.java:109)
  |         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
  | a:241)
  |         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
  | :844)
  |         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
  | ss(Http11Protocol.java:580)
  |         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
  | 7)
  |         at java.lang.Thread.run(Thread.java:595)
  | 11:21:24,938 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
  | org.jboss.ws.core.CommonSOAPFaultException: Endpoint {http://tesi/}TesiPort does
  |  not contain operation meta data for: getNumberOfRequest
  |         at org.jboss.ws.core.server.ServiceEndpointInvoker.getDispatchDestinatio
  | n(ServiceEndpointInvoker.java:457)
  |         at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpoin
  | tInvoker.java:176)
  |         at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHan
  | dlerImpl.java:408)
  |         at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHand
  | lerImpl.java:272)
  |         at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl
  | .java:189)
  |         at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(Request
  | HandlerImpl.java:122)
  |         at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java
  | :84)
  |         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
  | icationFilterChain.java:290)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
  | ilterChain.java:206)
  |         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
  | lter.java:96)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
  | icationFilterChain.java:235)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
  | ilterChain.java:206)
  |         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
  | alve.java:230)
  |         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
  | alve.java:175)
  |         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
  | yAssociationValve.java:179)
  |         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
  | e.java:84)
  |         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
  | ava:128)
  |         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
  | ava:104)
  |         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC
  | onnectionValve.java:157)
  |         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
  | ve.java:109)
  |         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
  | a:241)
  |         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
  | :844)
  |         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
  | ss(Http11Protocol.java:580)
  |         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
  | 7)
  |         at java.lang.Thread.run(Thread.java:595)
  | 11:21:24,981 ERROR [SOAPFaultHelperJAXRPC] SOAP request exception
  | javax.xml.rpc.soap.SOAPFaultException: Endpoint {http://tesi/}TesiPort does not
  | contain operation meta data for: getNumberOfRequest
  |         at org.jboss.ws.core.jaxrpc.SOAPFaultHelperJAXRPC.exceptionToFaultMessag
  | e(SOAPFaultHelperJAXRPC.java:189)
  |         at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.exceptionToFaultMessage(
  | SOAPFaultHelperJAXWS.java:157)
  |         at org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS.createFaultMessage
  | FromException(SOAP11BindingJAXWS.java:104)
  |         at org.jboss.ws.core.CommonSOAPBinding.bindFaultMessage(CommonSOAPBindin
  | g.java:645)
  |         at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHan
  | dlerImpl.java:430)
  |         at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHand
  | lerImpl.java:272)
  |         at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl
  | .java:189)
  |         at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(Request
  | HandlerImpl.java:122)
  |         at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java
  | :84)
  |         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
  | icationFilterChain.java:290)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
  | ilterChain.java:206)
  |         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
  | lter.java:96)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
  | icationFilterChain.java:235)
  |         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
  | ilterChain.java:206)
  |         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
  | alve.java:230)
  |         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
  | alve.java:175)
  |         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
  | yAssociationValve.java:179)
  |         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
  | e.java:84)
  |         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
  | ava:128)
  |         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
  | ava:104)
  |         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC
  | onnectionValve.java:157)
  |         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
  | ve.java:109)
  |         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
  | a:241)
  |         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
  | :844)
  |         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
  | ss(Http11Protocol.java:580)
  |         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
  | 7)
  |         at java.lang.Thread.run(Thread.java:595)
  | 

Instead the client give me this error:

  | Exception in thread "main" AxisFault
  |  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
  |  faultSubcode: 
  |  faultString: Endpoint {http://tesi/}TesiPort does not contain operation meta data for: getNumberOfRequest
  |  faultActor: 
  |  faultNode: 
  |  faultDetail: 
  | 	{http://xml.apache.org/axis/}stackTrace:Endpoint {http://tesi/}TesiPort does not contain operation meta data for: getNumberOfRequest
  | 	at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
  | 	at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
  | 	at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
  | 	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
  | 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
  | 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
  | 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
  | 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
  | 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
  | 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
  | 	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
  | 	at javax.xml.parsers.SAXParser.parse(Unknown Source)
  | 	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
  | 	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
  | 	at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
  | 	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
  | 	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
  | 	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
  | 	at org.apache.axis.client.Call.invoke(Call.java:2767)
  | 	at org.apache.axis.client.Call.invoke(Call.java:2443)
  | 	at org.apache.axis.client.Call.invoke(Call.java:2366)
  | 	at org.apache.axis.client.Call.invoke(Call.java:1812)
  | 	at ClientProva.main(ClientProva.java:48)
  | 
  | 	{http://xml.apache.org/axis/}hostname:server
  | 
  | Endpoint {http://tesi/}TesiPort does not contain operation meta data for: getNumberOfRequest
  | 	at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
  | 	at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
  | 	at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
  | 	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
  | 	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
  | 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
  | 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
  | 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
  | 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
  | 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
  | 	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
  | 	at javax.xml.parsers.SAXParser.parse(Unknown Source)
  | 	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
  | 	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
  | 	at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
  | 	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
  | 	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
  | 	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
  | 	at org.apache.axis.client.Call.invoke(Call.java:2767)
  | 	at org.apache.axis.client.Call.invoke(Call.java:2443)
  | 	at org.apache.axis.client.Call.invoke(Call.java:2366)
  | 	at org.apache.axis.client.Call.invoke(Call.java:1812)
  | 	at ClientProva.main(ClientProva.java:48)
  | 

I've tryed everything how can I create this holy dynamic client having only service Name, operation Name and enpoint address?

Thanks, bye bye.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4101171#4101171

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4101171



More information about the jboss-user mailing list