Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-482

AxisServiceBuilder API produces different operation description from what the generated stub does (InOutAxisOperation vs. OutInAxisOperation)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.94
    • 0.95
    • client-api
    • None
    • Windows XP with J2SE 5

    Description

      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 ) ); }

      Attachments

        Activity

          People

            Unassigned Unassigned
            rfeng Zhaohui Feng
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: