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 Paul Ashton <pa...@tourplan.com> on 2005/12/16 02:06:45 UTC

Stub problem trying to upgrade from Axis2 0.92 to Axis2 0.93

I have been using Axis2 0.92 to access a .Net web service from Java.
Today I tried to switch to Axis2 0.93.  I regenerated all of the stubs using
the 0.93 WSDL2Java, and put the Asix2 0.93 libraries on my classpath, but got the following error
when I tried a test:

org.apache.axis2.AxisFault: Server did not recognize the value of HTTP Header SOAPAction: .
	at org.apache.axis2.client.InOutMEPClient.invokeBlocking(InOutMEPClient.java:174)
	at codegen.TPServiceSoapStub.GetScrollRate(TPServiceSoapStub.java:330)
	at AxisTest.makeCall(AxisTest.java:71)
	at AxisTest.main(AxisTest.java:13)

The WSDL for GetScrollRate is

     <wsdl:operation name="GetScrollRate">
       <soap:operation soapAction="http://tourplan.com/engine/GetScrollRate" style="document" />
       <wsdl:input>
         <soap:body use="literal" />
       </wsdl:input>
       <wsdl:output>
         <soap:body use="literal" />
       </wsdl:output>
     </wsdl:operation>


I've appended the two stubs below.  The 0.92 stub includes the code

         _call.setSoapAction("http://tourplan.com/engine/GetScrollRate");

which seems to be what sets the soap action (the error for 0.93 seems to be that
the soap action isn't set).  The only code related to the soap action in the
0.93 stub is

              if(_clientOptions.getSoapAction() == null) {
              }

It seems that the body of the if statment (which should presumably set the soap
action) is missing.  Is there a bug in how 0.93 stubs are generated, or
have I made a mistake in setting up Axis 2 0.93?

Thanks, Paul.



---------------------------------------- Axis2 0.93 stub -----------------------------------------------


         public codegen.databinding.com.tourplan.GetScrollRateResponseDocument GetScrollRate(
          codegen.databinding.com.tourplan.GetScrollRateDocument param28) throws java.rmi.RemoteException{

		     org.apache.axis2.client.Call _call = new org.apache.axis2.client.Call(_serviceContext);
              _call.setClientOptions(_clientOptions);

  		     org.apache.axis2.context.MessageContext _messageContext = getMessageContext();
              if(_clientOptions.getSoapAction() == null) {

			 }

              if(_clientOptions.getAction() == null) {

			 }
              //set the properties
             populateModules(_call);

             org.apache.axis2.soap.SOAPEnvelope env = null;
             env = createEnvelope();


                //Style is Doc.

                setValueDoc(env,codegen.databinding.TPServiceSoapGetScrollRateDatabindingSupporter.toOM(param28));


              _messageContext.setEnvelope(env);

              //set the exception throwing status
              _call.getClientOptions().setExceptionToBeThrownOnSOAPFault(true);
              org.apache.axis2.context.MessageContext  _returnMessageContext = _call.invokeBlocking(_operations[4], _messageContext);
              org.apache.axis2.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();
              java.lang.Object object = codegen.databinding.TPServiceSoapGetScrollRateDatabindingSupporter.fromOM(getElement(_returnEnv,"doc"),codegen.databinding.com.tourplan.GetScrollRateResponseDocument.class);
              return (codegen.databinding.com.tourplan.GetScrollRateResponseDocument)object;



         }


---------------------------------------- Axis2 0.92 stub -----------------------------------------------

       public codegen.databinding.com.tourplan.GetScrollRateResponseDocument GetScrollRate(
          codegen.databinding.com.tourplan.GetScrollRateDocument param28) throws java.rmi.RemoteException{

		    org.apache.axis2.clientapi.Call _call = new org.apache.axis2.clientapi.Call(_serviceContext);
             _call.setTransportInfo(this.senderTransport,this.listenerTransport,this.useSeparateListener);
             _call.setDoREST(this.doRest);

  		    org.apache.axis2.context.MessageContext _messageContext = getMessageContext();
             _call.setTo(this.toEPR);
             _call.setSoapAction("http://tourplan.com/engine/GetScrollRate");


              //set the properties
             populateProperties(_call);
             org.apache.axis2.soap.SOAPEnvelope env = null;
             env = createEnvelope();


                //Style is Doc.

                setValueDoc(env,codegen.databinding.TPServiceSoapGetScrollRateDatabindingSupporter.toOM(param28));


              _messageContext.setEnvelope(env);

              //set the exception throwing status
              _call.setExceptionToBeThrownOnSOAPFault(true);
              org.apache.axis2.context.MessageContext  _returnMessageContext = _call.invokeBlocking(_operations[4], _messageContext);
              org.apache.axis2.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();
              java.lang.Object object = codegen.databinding.TPServiceSoapGetScrollRateDatabindingSupporter.fromOM(getElement(_returnEnv,"doc"),codegen.databinding.com.tourplan.GetScrollRateResponseDocument.class);
              return (codegen.databinding.com.tourplan.GetScrollRateResponseDocument)object;



         }


-- 
Paul Ashton
iCom Project Leader
Tourplan
Christchurch, New Zealand
Phone: +64 3 3669669
Fax: +64 3 3791091


Re: Stub problem trying to upgrade from Axis2 0.92 to Axis2 0.93

Posted by Davanum Srinivas <da...@gmail.com>.
Yes, i believe there was a bug in codegen. Please copy the following
line to your 0.93 generated stub for now

 _call.setSoapAction("http://tourplan.com/engine/GetScrollRate");

thanks,
dims

On 12/15/05, Paul Ashton <pa...@tourplan.com> wrote:
> I have been using Axis2 0.92 to access a .Net web service from Java.
> Today I tried to switch to Axis2 0.93.  I regenerated all of the stubs using
> the 0.93 WSDL2Java, and put the Asix2 0.93 libraries on my classpath, but got the following error
> when I tried a test:
>
> org.apache.axis2.AxisFault: Server did not recognize the value of HTTP Header SOAPAction: .
>         at org.apache.axis2.client.InOutMEPClient.invokeBlocking(InOutMEPClient.java:174)
>         at codegen.TPServiceSoapStub.GetScrollRate(TPServiceSoapStub.java:330)
>         at AxisTest.makeCall(AxisTest.java:71)
>         at AxisTest.main(AxisTest.java:13)
>
> The WSDL for GetScrollRate is
>
>      <wsdl:operation name="GetScrollRate">
>        <soap:operation soapAction="http://tourplan.com/engine/GetScrollRate" style="document" />
>        <wsdl:input>
>          <soap:body use="literal" />
>        </wsdl:input>
>        <wsdl:output>
>          <soap:body use="literal" />
>        </wsdl:output>
>      </wsdl:operation>
>
>
> I've appended the two stubs below.  The 0.92 stub includes the code
>
>          _call.setSoapAction("http://tourplan.com/engine/GetScrollRate");
>
> which seems to be what sets the soap action (the error for 0.93 seems to be that
> the soap action isn't set).  The only code related to the soap action in the
> 0.93 stub is
>
>               if(_clientOptions.getSoapAction() == null) {
>               }
>
> It seems that the body of the if statment (which should presumably set the soap
> action) is missing.  Is there a bug in how 0.93 stubs are generated, or
> have I made a mistake in setting up Axis 2 0.93?
>
> Thanks, Paul.
>
>
>
> ---------------------------------------- Axis2 0.93 stub -----------------------------------------------
>
>
>          public codegen.databinding.com.tourplan.GetScrollRateResponseDocument GetScrollRate(
>           codegen.databinding.com.tourplan.GetScrollRateDocument param28) throws java.rmi.RemoteException{
>
>                      org.apache.axis2.client.Call _call = new org.apache.axis2.client.Call(_serviceContext);
>               _call.setClientOptions(_clientOptions);
>
>                      org.apache.axis2.context.MessageContext _messageContext = getMessageContext();
>               if(_clientOptions.getSoapAction() == null) {
>
>                          }
>
>               if(_clientOptions.getAction() == null) {
>
>                          }
>               //set the properties
>              populateModules(_call);
>
>              org.apache.axis2.soap.SOAPEnvelope env = null;
>              env = createEnvelope();
>
>
>                 //Style is Doc.
>
>                 setValueDoc(env,codegen.databinding.TPServiceSoapGetScrollRateDatabindingSupporter.toOM(param28));
>
>
>               _messageContext.setEnvelope(env);
>
>               //set the exception throwing status
>               _call.getClientOptions().setExceptionToBeThrownOnSOAPFault(true);
>               org.apache.axis2.context.MessageContext  _returnMessageContext = _call.invokeBlocking(_operations[4], _messageContext);
>               org.apache.axis2.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();
>               java.lang.Object object = codegen.databinding.TPServiceSoapGetScrollRateDatabindingSupporter.fromOM(getElement(_returnEnv,"doc"),codegen.databinding.com.tourplan.GetScrollRateResponseDocument.class);
>               return (codegen.databinding.com.tourplan.GetScrollRateResponseDocument)object;
>
>
>
>          }
>
>
> ---------------------------------------- Axis2 0.92 stub -----------------------------------------------
>
>        public codegen.databinding.com.tourplan.GetScrollRateResponseDocument GetScrollRate(
>           codegen.databinding.com.tourplan.GetScrollRateDocument param28) throws java.rmi.RemoteException{
>
>                     org.apache.axis2.clientapi.Call _call = new org.apache.axis2.clientapi.Call(_serviceContext);
>              _call.setTransportInfo(this.senderTransport,this.listenerTransport,this.useSeparateListener);
>              _call.setDoREST(this.doRest);
>
>                     org.apache.axis2.context.MessageContext _messageContext = getMessageContext();
>              _call.setTo(this.toEPR);
>              _call.setSoapAction("http://tourplan.com/engine/GetScrollRate");
>
>
>               //set the properties
>              populateProperties(_call);
>              org.apache.axis2.soap.SOAPEnvelope env = null;
>              env = createEnvelope();
>
>
>                 //Style is Doc.
>
>                 setValueDoc(env,codegen.databinding.TPServiceSoapGetScrollRateDatabindingSupporter.toOM(param28));
>
>
>               _messageContext.setEnvelope(env);
>
>               //set the exception throwing status
>               _call.setExceptionToBeThrownOnSOAPFault(true);
>               org.apache.axis2.context.MessageContext  _returnMessageContext = _call.invokeBlocking(_operations[4], _messageContext);
>               org.apache.axis2.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();
>               java.lang.Object object = codegen.databinding.TPServiceSoapGetScrollRateDatabindingSupporter.fromOM(getElement(_returnEnv,"doc"),codegen.databinding.com.tourplan.GetScrollRateResponseDocument.class);
>               return (codegen.databinding.com.tourplan.GetScrollRateResponseDocument)object;
>
>
>
>          }
>
>
> --
> Paul Ashton
> iCom Project Leader
> Tourplan
> Christchurch, New Zealand
> Phone: +64 3 3669669
> Fax: +64 3 3791091
>
>


--
Davanum Srinivas : http://wso2.com/blogs/