4 Replies Latest reply: Aug 2, 2008 5:33 AM by 843785 RSS

    axis client error - No such operation 'arg0'

    843785
      Hi all,

      I am getting No such operation 'arg0' error when I am trying to connect a webservice from my client. The service is style=document and use='literal'

      My client code is -

      public static void main1(String [] args) {
      try {
                     String endpointURL = "http://localhost:9011/web-services/WSGoldBANotification";

      Service service = new Service();
      Call call = (Call) service.createCall();

      call.setTargetEndpointAddress(new java.net.URL(endpointURL) );
                call.setOperationName("BANRequest");
                     call.setEncodingStyle(null); //"literal"
                     call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
                     call.setOperationStyle(Style.DOCUMENT);
                     call.setOperationUse("literal");

                     Object ret = call.invoke( new Object[] { banRequestXml } );

      System.out.println("Object = " + ret.getClass().getName());
      System.out.println("Response Returned : " + ret.toString());
      } catch (Exception e) {
      System.err.println(e.toString());
      }
      }

      String banRequestXml = "public static final String banRequestXml = "<datsoilingAccountDocument> <Header> <SystemSourceID>CORE</SystemSourceID> <ServerSourceID>10.67.153.32</ServerSourceID> <User>TEST_POLARIS</User> <Operation>Update</Operation> <UpdateTimestamp>2008-07-24T09:22:25.000</UpdateTimestamp> </Header> <soilingAccount> <OwnerOrganization>EQUANT</OwnerOrganization> <CoreId>50005040</CoreId> <ICO1Code>10964</ICO1Code> <CustomerName>LOreal</CustomerName> <BaNumber>09068-02</BaNumber> <BaName>L'Oreal Dpgp</BaName> </soilingAccount></datsoilingAccountDocument>";


      -----------------------------------------------------------

      My partial WSDL is -


           <wsdl:portType name="Ordering_BanInterface_servicesPortType">
                <wsdl:operation name="BANRequest">
                     <wsdl:input message="tns:GoldBANotificationInput"/>
                     <wsdl:output message="tns:GoldBANotificationOutput"/>
                </wsdl:operation>
           </wsdl:portType>

           <wsdl:binding name="Ordering_BanInterface_servicesBinding" type="tns:Ordering_BanInterface_servicesPortType">     
                <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>     
                <wsdl:operation name="BANRequest">
                     <soap:operation soapAction=""/>
                     <wsdl:input>
                          <soap:body use="literal"/>
                     </wsdl:input>
                     <wsdl:output>
                          <soap:body use="literal"/>
                     </wsdl:output>
                </wsdl:operation>
           </wsdl:binding>

      ----------------------------------

      WSDD section -

      <service name="WSGoldBANotification" provider="java:RPC" style="wrapped" use="literal">
      <operation name="BANRequest" qname="BANRequest" returnQName="response" returnType="xsd:string" soapAction="" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <parameter name="request" type="xsd:string"/>
      </operation>
      <parameter name="allowedMethods" value="BANRequest"/>
      <parameter name="typeMappingVersion" value="1.2"/>
      <parameter name="wsdlPortType" value="Ordering_BanInterface_servicesPortType"/>
      <parameter name="className" value="com.equant.gold.interfaces.ban.ws.Ordering_BanInterface_servicesBindingImpl"/>
      <parameter name="wsdlServicePort" value="WSGoldBANotification"/>
      <parameter name="wsdlTargetNamespace" value="http://1.0.0.27/"/>
      <parameter name="wsdlServiceElement" value="WSGoldBANotificationService"/>
      </service>
      --------------------------

      any help would be appreciated. Need it very urgently.
        • 1. Re: axis client error - No such operation 'arg0'
          843785
          where is your main method in your client code?


          dont show us this.... :)
          public static void main1(String [] args) {
          But I do not know whether this is the actual problem!
          • 2. Re: axis client error - No such operation 'arg0'
            843785
            No, this is not the prob. I was trying couple of things so using various main methods :)

            I have made more changes so, my problem is that I have the web service up and running, the wsdd entry for that is -


            <service name="WSGoldBANotification" provider="java:RPC" style="document" use="literal">
            <operation name="BANRequest" qname="ns2:BANRequest" returnQName="ns1:baResponse" returnType="ns1:baResponse" soapAction="http://tempuri.org/WSCoreGetPendingBA/action/BA.GetPendingBA" xmlns:ns1="http://tempuri.org/WSCoreGetPendingBA/type/" xmlns:ns2="http://tempuri.org/WSCoreGetPendingBA/message/">
            <parameter qname="ns1:baRequest" type="ns1:baRequest"/>
            </operation>
            <parameter name="allowedMethods" value="BANRequest"/>
            <parameter name="typeMappingVersion" value="1.2"/>
            <parameter name="wsdlPortType" value="Ordering_BanInterface_servicesPortType"/>
            <parameter name="className" value="com.equant.gold.interfaces.ban.ws.Ordering_BanInterface_servicesBindingImpl"/>
            <parameter name="wsdlServicePort" value="WSGoldBANotification"/>
            <parameter name="schemaQualified" value="http://tempuri.org/WSCoreGetPendingBA/type/"/>
            <parameter name="wsdlTargetNamespace" value="http://10.239.30.79/"/>
            <parameter name="wsdlServiceElement" value="WSGoldBANotificationService"/>
            <typeMapping deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory" encodingStyle="" qname="ns3:baResponse" serializer="org.apache.axis.encoding.ser.BeanSerializerFactory" type="java:com.equant.gold.interfaces.ban.ws.BaResponse" xmlns:ns3="http://tempuri.org/WSCoreGetPendingBA/type/"/>
            <typeMapping deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory" encodingStyle="" qname="ns4:baRequest" serializer="org.apache.axis.encoding.ser.BeanSerializerFactory" type="java:com.equant.gold.interfaces.ban.ws.BaRequest" xmlns:ns4="http://tempuri.org/WSCoreGetPendingBA/type/"/>
            </service>

            -------------------------------------------

            and my client code is -

            public static void main(String [] args) {
            try {
                           String endpointURL = "http://localhost:9011/web-services/WSGoldBANotification";

            Service service = new Service();
            Call call = (Call) service.createCall();

            call.setTargetEndpointAddress(new java.net.URL(endpointURL) );
                           call.setOperationName("BANRequest");
                           call.setOperationStyle(Style.DOCUMENT);
                           call.setOperationUse("literal");

                           Object ret = call.invoke( new Object[] { banRequestXml } );

            System.out.println("Object = " + ret.getClass().getName());
            System.out.println("Response Returned : " + ret.toString());
            } catch (Exception e) {
            System.err.println(e.toString());
            }
            }


            public static final String banRequestXml = "<GOLDBillingAccountDocument> <name>Hello</name> </GOLDBillingAccountDocument>";

            ---------------------------------------------------------------------------

            I am getting following error when i execute this client -

            Exception in thread "main" AxisFault
            faultCode: {http://xml.apache.org/axis/}Client
            faultSubcode:
            faultString: No such operation 'GOLDBillingAccountDocument'
            faultActor:
            faultNode:
            faultDetail:
            {http://xml.apache.org/axis/}hostname:vsingh26

            No such operation 'GOLDBillingAccountDocument'
            at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder
            .java:221)
            at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.
            java:128)
            at org.apache.axis.encoding.DeserializationContext.endElement(Deserializ
            ationContext.java:1087)
            at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endEleme
            nt(AbstractSAXParser.java:633)
            at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scan
            EndElement(XMLNSDocumentScannerImpl.java:719)
            at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
            l$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
            at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
            l.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
            at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
            ML11Configuration.java:834)
            at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
            ML11Configuration.java:764)
            at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
            java:148)




            How to resolve it? How do I let it know that <golddoc...> tag is not a method .. but the input data?
            • 3. Re: axis client error - No such operation 'arg0'
              843785
              Anyone with answer, need it badly!!!

              Edited by: urahc on Aug 1, 2008 1:12 PM

              Edited by: urahc on Aug 1, 2008 11:37 PM
              • 4. Re: axis client error - No such operation 'arg0'
                843785
                Im not sure, but I think you need to change this:
                public static final String banRequestXml = "<GOLDBillingAccountDocument> <name>Hello</name> </GOLDBillingAccountDocument>";
                To something like this:
                public static final String banRequestXml = "/<GOLDBillingAccountDocument/> /<name/>Hello/<//name/> /<//GOLDBillingAccountDocument/>";