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 Ma...@tk-online.de on 2007/09/24 17:54:17 UTC

Calling Axis1 Service with Axis2 Client

Hi,

I'm trying to migrate from Axis1 to Axis2, but have to call an external 
Service running under Axis1. The Axis1 code to call the service is 
following:

      Service externalService = new Service()
      Call externalServiceCall = (Call) externalService.createCall();
      externalServiceCall.setTargetEndpointAddress(EXTERNAL_SRV_URL);
      externalServiceCall.setOperationName(new QName("ExternalServiceNS", 
"externalOperation"));
      externalServiceCall.addParameter("arg1", XMLType.SOAP_ARRAY, 
ParameterMode.IN);
      externalServiceCall.setReturnType(XMLType.SOAP_ARRAY);
      String[] result = (String[]) externalServiceCalll.invoke(new 
Object[] { new String[] {"abc", "xyz"} });

I tried the following Axis2-Code, but it doesn't work (errormessage: No 
such operation 'externalOperation'):

      RPCServiceClient externalService = new RPCServiceClient();
      Options options = new Options();
      options.setTo(EXTERNAL_SRV_URL);
      options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
      externalService.setOptions(options);
      String[] result = (String[]) externalService.invokeBlocking(new 
QName("ExternalServiceNS", "externalOperation"), new Object[] { new 
String[] {"abc", "xyz"} }, new Class[] { String[].class } );


Thanks,
Markus

Re: Calling Axis1 Service with Axis2 Client

Posted by Anne Thomas Manes <at...@gmail.com>.
It appears that the service you are trying to call uses RPC/encoded,
and Axis2 does not support RPC encoding.

Anne

On 9/24/07, Markus.Hampel@tk-online.de <Ma...@tk-online.de> wrote:
>
> Hi,
>
> I'm trying to migrate from Axis1 to Axis2, but have to call an external
> Service running under Axis1. The Axis1 code to call the service is
> following:
>
>       Service externalService = new Service()
>       Call externalServiceCall = (Call) externalService.createCall();
>
> externalServiceCall.setTargetEndpointAddress(EXTERNAL_SRV_URL);
>       externalServiceCall.setOperationName(new
> QName("ExternalServiceNS", "externalOperation"));
>       externalServiceCall.addParameter("arg1",
> XMLType.SOAP_ARRAY, ParameterMode.IN);
>
> externalServiceCall.setReturnType(XMLType.SOAP_ARRAY);
>       String[] result = (String[]) externalServiceCalll.invoke(new Object[]
> { new String[] {"abc", "xyz"} });
>
> I tried the following Axis2-Code, but it doesn't work (errormessage: No such
> operation 'externalOperation'):
>
>       RPCServiceClient externalService = new RPCServiceClient();
>       Options options = new Options();
>       options.setTo(EXTERNAL_SRV_URL);
>       options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
>       externalService.setOptions(options);
>       String[] result = (String[]) externalService.invokeBlocking(new
> QName("ExternalServiceNS", "externalOperation"), new Object[] { new String[]
> {"abc", "xyz"} }, new Class[] { String[].class } );
>
>
> Thanks,
> Markus

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