axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diego <di...@tiscalinet.it>
Subject [axis2 - 1.0] blocking dual client help
Date Sun, 07 May 2006 08:53:51 GMT
Hi everybody,

I get this exception:


Exception in thread "main" java.lang.NullPointerException
         at 
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:260)
         at 
org.astrodas.ws.peer.AstrodasPeerStub.insertMappingAnnotations(AstrodasPeerStub.java:123)
         at 
org.astrodas.ws.peer.AstrodasPeerProxy.insertMappingAnnotations(AstrodasPeerProxy.java:36)
         at org.astrodas.test.Populate.populateLocal(Populate.java:239)
         at org.astrodas.test.Populate.main(Populate.java:350)


when trying to invoke a blocking dual client with the following code, 
that I have modified from the generated stub.

Thanks a lot for any help!

Diego


public org.astrodas.ws.model.InsertMappingAnnotationsResponseDocument 
insertMappingAnnotations(
     org.astrodas.ws.model.InsertMappingAnnotationsDocument param4)
     throws java.rmi.RemoteException {
     try {
         org.apache.axis2.client.OperationClient _operationClient = 
_serviceClient.createClient(_operations[0].getName());
 
_operationClient.getOptions().setAction("insertMappingAnnotations");
 
_operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);

         // Dual client
 
_operationClient.getOptions().setTransportInProtocol(Constants.TRANSPORT_HTTP);
         _operationClient.getOptions().setUseSeparateListener(true);
         _operationClient.getOptions().setAction("urn:echo");
         _serviceClient.engageModule(new 
javax.xml.namespace.QName(Constants.MODULE_ADDRESSING));

         // create SOAP envelope with that payload
         org.apache.axiom.soap.SOAPEnvelope env = null;

         //Style is Doc.
         env = toEnvelope(getFactory(_operationClient.getOptions()
                                                     .getSoapVersionURI()),
                 param4,
                 optimizeContent(
                     new javax.xml.namespace.QName("",
                         "insertMappingAnnotations")));

         // create message context with that soap envelope
         org.apache.axis2.context.MessageContext _messageContext = new 
org.apache.axis2.context.MessageContext();
         _messageContext.setEnvelope(env);

         // add the message contxt to the operation client
         _operationClient.addMessageContext(_messageContext);

         //execute the operation client
         _operationClient.execute(true);

         org.apache.axis2.context.MessageContext _returnMessageContext = 
_operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);
         org.apache.axiom.soap.SOAPEnvelope _returnEnv = 
_returnMessageContext.getEnvelope();

         java.lang.Object object = fromOM(getElement(_returnEnv, 
"document"),
 
org.astrodas.ws.model.InsertMappingAnnotationsResponseDocument.class,
                 getEnvelopeNamespaces(_returnEnv));
 
_messageContext.getTransportOut().getSender().cleanup(_messageContext);

         return 
(org.astrodas.ws.model.InsertMappingAnnotationsResponseDocument) object;
     } catch (org.apache.axis2.AxisFault f) {
         org.apache.axiom.om.OMElement faultElt = f.getDetail();

         if (faultElt != null) {
           ...
         } 
 

     }
}

Mime
View raw message