You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Deepal Jayasinghe (JIRA)" <ji...@apache.org> on 2006/03/03 10:55:46 UTC
[jira] Commented: (AXIS2-482) AxisServiceBuilder API produces
different operation description from what the generated stub does
(InOutAxisOperation vs. OutInAxisOperation)
[ http://issues.apache.org/jira/browse/AXIS2-482?page=comments#action_12368683 ]
Deepal Jayasinghe commented on AXIS2-482:
-----------------------------------------
Hmmmm , AxisServiceBuilder is to create a service for server side (there is a bit difference between client side service and server side , need to reverse the MEP) , so if you use that to create Client side server that wont work, the solution is to use the following code snippet to get the job done.
axisService = ClientUtils.creatAxisService(wsdlURL, wsdlServiceName, portName, options);
can I close the issue ? ........ :)
> AxisServiceBuilder API produces different operation description from what the generated stub does (InOutAxisOperation vs. OutInAxisOperation)
> ---------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AXIS2-482
> URL: http://issues.apache.org/jira/browse/AXIS2-482
> Project: Apache Axis 2.0 (Axis2)
> Type: Bug
> Components: client-api
> Versions: 0.94
> Environment: Windows XP with J2SE 5
> Reporter: Raymond Feng
>
> Here's the code I use:
> AxisServiceBuilder builder = new AxisServiceBuilder();
> AxisService service = builder.getAxisService( wsdl.openStream() ); // wsdl is the url pointing to the WSDL file
> _serviceClient = new ServiceClient( configurationContext, service );
> QName operation= new QName( "", "getGreetings" );
> OperationClient _operationClient = _serviceClient.createClient( operation );
> I got the following exception because the operation is AxisInOutOperation which doesn't implement the createClient().
> Exception in thread "main" java.lang.UnsupportedOperationException: The MEP you are using (http://www.w3.org/2004/08/wsdl/in-out) has not implemented createClient().
> at org.apache.axis2.description.AxisOperation.createClient(AxisOperation.java:427)
> at org.apache.axis2.client.ServiceClient.createClient(ServiceClient.java:442)
> Here's the generated stub code: (Note it creates OutInAxisOperation instead).
> static
> {
> //creating the Service
> _service = new org.apache.axis2.description.AxisService( "HelloWorldServiceImpl" );
> //creating the operations
> org.apache.axis2.description.AxisOperation __operation;
> _operations = new org.apache.axis2.description.OutInAxisOperation[1];
> __operation = new org.apache.axis2.description.OutInAxisOperation();
> __operation.setName( new javax.xml.namespace.QName( "http://helloworldaxis.samples.tuscany.apache.org",
> "getGreetings" ) );
> _operations[0] = __operation;
> _service.addOperation( __operation );
> }
> public HelloWorldServiceImplStub( org.apache.axis2.context.ConfigurationContext configurationContext,
> String targetEndpoint )
> throws java.lang.Exception
> {
> _serviceClient = new org.apache.axis2.client.ServiceClient( configurationContext, _service );
> _serviceClient.getOptions().setTo( new org.apache.axis2.addressing.EndpointReference( targetEndpoint ) );
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira