Hi,

The source code in my *ServiceStub.java is:

org.apache.axis2.context.MessageContext _messageContext = new
org.apache.axis2.context.MessageContext();
_messageContext.setEnvelope(env);

_operationClient.addMessageContext(_messageContext);
                
                                        
Callback callbackClient= new Callback() {...};
_operationClient.setCallback(callbackClient); 
        
_operationClient.getOptions().setUseSeparateListener(true);
_operationClient.getOptions().setTransportInProtocol(Constants.TRANSPORT_HTT
P);             
        
CallbackReceiver _callbackReceiver= null;
                
if (_operations[0].getMessageReceiver() == null &&
_operationClient.getOptions().isUseSeparateListener()) {                
        _callbackReceiver = new CallbackReceiver();
_operations[0].setMessageReceiver(_callbackReceiver);                   
}
                
_operationClient.execute(false);                
_operations[0].getMessageReceiver().receive(_messageContext);

I don´t know how to obtain the result, I do
_operations[0].getMessageReceiver().receive(_messageContext) but it isn´t
right because _messageContext contain the message that I use to call the web
service not the response, but I don´t know where to find the messageContext
with the response. Can you help me? And that is why I haven´t a relatesTo
value.


-----Mensaje original-----
De: Eran Chinthaka [mailto:[EMAIL PROTECTED] 
Enviado el: sábado, 22 de julio de 2006 16:28
Para: [email protected]
Asunto: Re: [Axis2] Non-blocking dual client

Hi Marta,

If there is an NPE, I will fix it.

But I'm sorry I'm missing something here. You *must* have a relatesTo
value, when you do a dual channel, non-blocking invocation. So what do
you mean by saying "in my case relatesTO is null"?


-- Chinthaka


Marta García Rueda wrote:
> I´m very sorry, I don´t explain my problem well.
> You are right, I´m trying to do a dual channel non-blocking client and the
> CodeGen generates my CallbackHandler, I´m using ADB also.
> 
> The problem it´s that when I´m trying to obtain the result for:
> callbackReceiver.receive(messageContext) I have an exception.
> 
> java.lang.NullPointerException at
> org.apache.axis2.util.CallbackReceiver.receive(CallbackReceiver.java:32)
> 
> I have seen that the method receive in
> org.apache.axis2.util.CallbackReceiver makes 
> RelatesTo relatesTO = messageCtx.getOptions().getRelatesTo();
> String messageID = relatesTO.getValue();
> 
> And in my case relatesTO is null so messageID throws an exception and I
> can´t obtain the result. So, callback in never onComplete and the
> CallbackHandler is never call.
> 
> My client works fine but I don´t know how to obtain the webservice
response.
> 
> 
> Thank you very much.
> 
> Marta García.
> 
> -----Mensaje original-----
> De: robert lazarski [mailto:[EMAIL PROTECTED] 
> Enviado el: miércoles, 19 de julio de 2006 20:32
> Para: [email protected]
> Asunto: Re: [Axis2] Non-blocking dual client
> 
> You're trying to do dual channel non-blocking, right?  Several things
> here don't make sense to me here. Perhaps with some more info maybe we
> can help:
> 
> 1) You say you are using codegen with a hashMap - but there is no wsdl
> type for java.util.HashMap .
> 
> 2) CodeGen generates its own *CallbackHandler.java , right? The code
> you are showing looks like its from the code gen stub. What you really
> need to do, IMHO, is implement your
> *CallbackHandler.java methods and invoke your Stub.start* (at least
> using xmlbeans, probably the samething for ADB) methods that receive
> the argument of *CallbackHandler .
> 
> HTH,
> Robert
> http://www.braziloutsource.com/
> 
> On 7/19/06, Marta García Rueda <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>> Hi,
>>
>> I´m doing an asynchronous client for a web services with the Code
> Generator
>> Tool and my stub class it´s like that:
>>
>>
>>
>> _operationClient.getOptions().setUseSeparateListener(true);
>>
>>
>
_operationClient.getOptions().setTransportInProtocol(org.apache.axis2.Consta
> nts.TRANSPORT_HTTP);
>> org.apache.axis2.util.CallbackReceiver _callbackReceiver =
>> null;
>>
>> if (_operations[0].getMessageReceiver() == null &&
>> _operationClient.getOptions().isUseSeparateListener()) {
>>
>> _callbackReceiver = new
>> org.apache.axis2.util.CallbackReceiver();
>>
>>
>> _operations[0].setMessageReceiver(_callbackReceiver);
>>
>> }
>>
>> _operationClient.execute(false);
>>
>>
>>
>> When I debug this I see that the object callbackReceiver has the result
in
> a
>> hashMap callbackStore. But I don´t know how to retrieve the result. I
have
>> to implement a Listener o something like that? Could you tell me where
can
> I
>> find an example?
>>
>>
>>
>> Thank you very much.
>>
>> Marta García.
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to