You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Michele Mazzucco <Mi...@ncl.ac.uk> on 2006/06/23 13:03:25 UTC

[Axis2] Web service calling another web service problem

Hi all,

I'm trying to let a web service A calling a web service B works, but it
doesn't work:
service A calls the MyService.echo() method (see userguide folder) when
certain events happen. I see service B receives the message, but the
response is not delivered to A.

Service A is as follows:

{
....
client(targetNode);
}

private void client(String node) throws AxisFault {
	String target = createTargetPath(node);				
	EndpointReference targetEPR = new EndpointReference(target);
		
	OMElement payload = getEchoOMElement();
	Options options = new Options();
	options.setTo(targetEPR);
	options.setAction("urn:echo");
      	options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
      	options.setUseSeparateListener(true);
		
	ServiceClient sender = new ServiceClient();
	sender.engageModule(new QName(Constants.MODULE_ADDRESSING));
	sender.setOptions(options);
		
	OMElement result = sender.sendReceive(payload);
	log.info("Result [" + result.toString() + "]"); <-- I can't see this log
}

private static OMElement getEchoOMElement() {
      OMFactory fac = OMAbstractFactory.getOMFactory();
      OMNamespace omNs = fac.createOMNamespace(
              "http://example1.org/example1", "example1");
      OMElement method = fac.createOMElement("echo", omNs);
      OMElement value = fac.createOMElement("Text", omNs);
      value.addChild(fac.createOMText(value, "Axis2 Echo String "));
      method.addChild(value);

      return method;
}



Any idea?

Thanks,
Michele

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [Axis2] Web service calling another web service problem

Posted by Deepal Jayasinghe <de...@opensource.lk>.
I mean I have only  tested in  war distribution.

Michele Mazzucco wrote:

>Hi Deepal,
>
>what does 'in war distribution not in SimpleHTTPServer case' mean?, I'm
>using the war distribution.
>
>Michele
>
>Deepal Jayasinghe wrote:
>  
>
>>In the current codebase this should work (I have tested and confirmed
>>that ) , I mean only in war distribution not in SimpleHTTPServer case.
>>
>>Michele Mazzucco wrote:
>>
>>    
>>
>>>Hi all,
>>>
>>>I'm trying to let a web service A calling a web service B works, but it
>>>doesn't work:
>>>service A calls the MyService.echo() method (see userguide folder) when
>>>certain events happen. I see service B receives the message, but the
>>>response is not delivered to A.
>>>
>>>Service A is as follows:
>>>
>>>{
>>>....
>>>client(targetNode);
>>>}
>>>
>>>private void client(String node) throws AxisFault {
>>>	String target = createTargetPath(node);				
>>>	EndpointReference targetEPR = new EndpointReference(target);
>>>		
>>>	OMElement payload = getEchoOMElement();
>>>	Options options = new Options();
>>>	options.setTo(targetEPR);
>>>	options.setAction("urn:echo");
>>>     	options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
>>>     	options.setUseSeparateListener(true);
>>>		
>>>	ServiceClient sender = new ServiceClient();
>>>	sender.engageModule(new QName(Constants.MODULE_ADDRESSING));
>>>	sender.setOptions(options);
>>>		
>>>	OMElement result = sender.sendReceive(payload);
>>>	log.info("Result [" + result.toString() + "]"); <-- I can't see this log
>>>}
>>>
>>>private static OMElement getEchoOMElement() {
>>>     OMFactory fac = OMAbstractFactory.getOMFactory();
>>>     OMNamespace omNs = fac.createOMNamespace(
>>>             "http://example1.org/example1", "example1");
>>>     OMElement method = fac.createOMElement("echo", omNs);
>>>     OMElement value = fac.createOMElement("Text", omNs);
>>>     value.addChild(fac.createOMText(value, "Axis2 Echo String "));
>>>     method.addChild(value);
>>>
>>>     return method;
>>>}
>>>
>>>
>>>
>>>Any idea?
>>>
>>>Thanks,
>>>Michele
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>>>For additional commands, e-mail: axis-user-help@ws.apache.org
>>>
>>>
>>>
>>> 
>>>
>>>      
>>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
>  
>

-- 
Thanks,
Deepal
................................................................
~Future is Open~ 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [Axis2] Web service calling another web service problem

Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
Hi Deepal,

what does 'in war distribution not in SimpleHTTPServer case' mean?, I'm
using the war distribution.

Michele

Deepal Jayasinghe wrote:
> In the current codebase this should work (I have tested and confirmed
> that ) , I mean only in war distribution not in SimpleHTTPServer case.
> 
> Michele Mazzucco wrote:
> 
>> Hi all,
>>
>> I'm trying to let a web service A calling a web service B works, but it
>> doesn't work:
>> service A calls the MyService.echo() method (see userguide folder) when
>> certain events happen. I see service B receives the message, but the
>> response is not delivered to A.
>>
>> Service A is as follows:
>>
>> {
>> ....
>> client(targetNode);
>> }
>>
>> private void client(String node) throws AxisFault {
>> 	String target = createTargetPath(node);				
>> 	EndpointReference targetEPR = new EndpointReference(target);
>> 		
>> 	OMElement payload = getEchoOMElement();
>> 	Options options = new Options();
>> 	options.setTo(targetEPR);
>> 	options.setAction("urn:echo");
>>      	options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
>>      	options.setUseSeparateListener(true);
>> 		
>> 	ServiceClient sender = new ServiceClient();
>> 	sender.engageModule(new QName(Constants.MODULE_ADDRESSING));
>> 	sender.setOptions(options);
>> 		
>> 	OMElement result = sender.sendReceive(payload);
>> 	log.info("Result [" + result.toString() + "]"); <-- I can't see this log
>> }
>>
>> private static OMElement getEchoOMElement() {
>>      OMFactory fac = OMAbstractFactory.getOMFactory();
>>      OMNamespace omNs = fac.createOMNamespace(
>>              "http://example1.org/example1", "example1");
>>      OMElement method = fac.createOMElement("echo", omNs);
>>      OMElement value = fac.createOMElement("Text", omNs);
>>      value.addChild(fac.createOMText(value, "Axis2 Echo String "));
>>      method.addChild(value);
>>
>>      return method;
>> }
>>
>>
>>
>> Any idea?
>>
>> Thanks,
>> Michele
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>>
>>  
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [Axis2] Web service calling another web service problem

Posted by Deepal Jayasinghe <de...@opensource.lk>.
In the current codebase this should work (I have tested and confirmed
that ) , I mean only in war distribution not in SimpleHTTPServer case.

Michele Mazzucco wrote:

>Hi all,
>
>I'm trying to let a web service A calling a web service B works, but it
>doesn't work:
>service A calls the MyService.echo() method (see userguide folder) when
>certain events happen. I see service B receives the message, but the
>response is not delivered to A.
>
>Service A is as follows:
>
>{
>....
>client(targetNode);
>}
>
>private void client(String node) throws AxisFault {
>	String target = createTargetPath(node);				
>	EndpointReference targetEPR = new EndpointReference(target);
>		
>	OMElement payload = getEchoOMElement();
>	Options options = new Options();
>	options.setTo(targetEPR);
>	options.setAction("urn:echo");
>      	options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
>      	options.setUseSeparateListener(true);
>		
>	ServiceClient sender = new ServiceClient();
>	sender.engageModule(new QName(Constants.MODULE_ADDRESSING));
>	sender.setOptions(options);
>		
>	OMElement result = sender.sendReceive(payload);
>	log.info("Result [" + result.toString() + "]"); <-- I can't see this log
>}
>
>private static OMElement getEchoOMElement() {
>      OMFactory fac = OMAbstractFactory.getOMFactory();
>      OMNamespace omNs = fac.createOMNamespace(
>              "http://example1.org/example1", "example1");
>      OMElement method = fac.createOMElement("echo", omNs);
>      OMElement value = fac.createOMElement("Text", omNs);
>      value.addChild(fac.createOMText(value, "Axis2 Echo String "));
>      method.addChild(value);
>
>      return method;
>}
>
>
>
>Any idea?
>
>Thanks,
>Michele
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
>  
>

-- 
Thanks,
Deepal
................................................................
~Future is Open~ 




---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org