Note that there are some explanatory texts on larger screens.

plurals
  1. POWeb Service method in AXIS2 receives null arguments. Why?
    primarykey
    data
    text
    <p>I am new to java web services. While trying out a basic web service operation, I got stuck. I have been following this <a href="http://www.softwareagility.gr/index.php?q=node/21" rel="nofollow">article</a> as a reference. The service class is pretty simple and looks like this:</p> <pre><code>public class MyService { public MyService() { } public Boolean Configure(String param, String val){ System.out.println("First arg: " + param + " Second arg:" + val); //Added by me. return true; } public Boolean StartMe(){ return true; } public Boolean StopMe(){ return true; } public String getStatus(){ return "No status available!"; } } </code></pre> <p>I have created the service using Eclipse (Bottom up Java bean Web Service) as mentioned on that article. To test my service I used Eclipse <strong>Web Service Explorer</strong>.</p> <p>Now here comes the issue. When I set param values in the service explorer and hit go I see null values getting printed in the console (<strong>First arg: null Second arg:null</strong>). I have tried to solve this for many hours but still no luck. But there is no problem with other three methods. They are giving responses and I can see it in the service explorer. The WSDL that have been generated is this:</p> <pre><code>&lt;wsdl:definitions targetNamespace="http://service.myapp.com"&gt; &lt;wsdl:documentation&gt; Please Type your service description here &lt;/wsdl:documentation&gt; &lt;wsdl:types&gt; &lt;xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://service.myapp.com"&gt; &lt;xs:element name="Configure"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element minOccurs="0" name="param" nillable="true" type="xs:string"/&gt;&lt;xs:element minOccurs="0" name="val" nillable="true" type="xs:string"/&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="ConfigureResponse"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element minOccurs="0" name="return" type="xs:boolean"/&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="StartMeResponse"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element minOccurs="0" name="return" type="xs:boolean"/&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="StopMeResponse"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element minOccurs="0" name="return" type="xs:boolean"/&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="getStatusResponse"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;/xs:schema&gt; &lt;/wsdl:types&gt;&lt;wsdl:message name="StartMeRequest"/&gt; &lt;wsdl:message name="StartMeResponse"&gt; &lt;wsdl:part name="parameters" element="ns:StartMeResponse"/&gt; &lt;/wsdl:message&gt; &lt;wsdl:message name="ConfigureRequest"&gt; &lt;wsdl:part name="parameters" element="ns:Configure"/&gt; &lt;/wsdl:message&gt; &lt;wsdl:message name="ConfigureResponse"&gt; &lt;wsdl:part name="parameters" element="ns:ConfigureResponse"/&gt; &lt;/wsdl:message&gt;&lt;wsdl:message name="getStatusRequest"/&gt; &lt;wsdl:message name="getStatusResponse"&gt; &lt;wsdl:part name="parameters" element="ns:getStatusResponse"/&gt; &lt;/wsdl:message&gt;&lt;wsdl:message name="StopMeRequest"/&gt; &lt;wsdl:message name="StopMeResponse"&gt; &lt;wsdl:part name="parameters" element="ns:StopMeResponse"/&gt; &lt;/wsdl:message&gt; &lt;wsdl:portType name="MyServicePortType"&gt; &lt;wsdl:operation name="StartMe"&gt; &lt;wsdl:input message="ns:StartMeRequest" wsaw:Action="urn:StartMe"/&gt;&lt;wsdl:output message="ns:StartMeResponse" wsaw:Action="urn:StartMeResponse"/&gt; &lt;/wsdl:operation&gt; &lt;wsdl:operation name="Configure"&gt; &lt;wsdl:input message="ns:ConfigureRequest" wsaw:Action="urn:Configure"/&gt;&lt;wsdl:output message="ns:ConfigureResponse" wsaw:Action="urn:ConfigureResponse"/&gt; &lt;/wsdl:operation&gt; &lt;wsdl:operation name="getStatus"&gt; &lt;wsdl:input message="ns:getStatusRequest" wsaw:Action="urn:getStatus"/&gt;&lt;wsdl:output message="ns:getStatusResponse" wsaw:Action="urn:getStatusResponse"/&gt; &lt;/wsdl:operation&gt; &lt;wsdl:operation name="StopMe"&gt; &lt;wsdl:input message="ns:StopMeRequest" wsaw:Action="urn:StopMe"/&gt;&lt;wsdl:output message="ns:StopMeResponse" wsaw:Action="urn:StopMeResponse"/&gt; &lt;/wsdl:operation&gt; &lt;/wsdl:portType&gt; &lt;wsdl:binding name="MyServiceSoap11Binding" type="ns:MyServicePortType"&gt; &lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/&gt; &lt;wsdl:operation name="StartMe"&gt; &lt;soap:operation soapAction="urn:StartMe" style="document"/&gt; &lt;wsdl:input&gt; &lt;soap:body use="literal"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output&gt; &lt;soap:body use="literal"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;wsdl:operation name="Configure"&gt; &lt;soap:operation soapAction="urn:Configure" style="document"/&gt; &lt;wsdl:input&gt; &lt;soap:body use="literal"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output&gt; &lt;soap:body use="literal"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;wsdl:operation name="getStatus"&gt; &lt;soap:operation soapAction="urn:getStatus" style="document"/&gt; &lt;wsdl:input&gt; &lt;soap:body use="literal"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output&gt; &lt;soap:body use="literal"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;wsdl:operation name="StopMe"&gt; &lt;soap:operation soapAction="urn:StopMe" style="document"/&gt; &lt;wsdl:input&gt; &lt;soap:body use="literal"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output&gt; &lt;soap:body use="literal"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;/wsdl:binding&gt; &lt;wsdl:binding name="MyServiceSoap12Binding" type="ns:MyServicePortType"&gt; &lt;soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/&gt; &lt;wsdl:operation name="StartMe"&gt; &lt;soap12:operation soapAction="urn:StartMe" style="document"/&gt; &lt;wsdl:input&gt; &lt;soap12:body use="literal"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output&gt; &lt;soap12:body use="literal"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;wsdl:operation name="Configure"&gt; &lt;soap12:operation soapAction="urn:Configure" style="document"/&gt; &lt;wsdl:input&gt; &lt;soap12:body use="literal"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output&gt; &lt;soap12:body use="literal"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;wsdl:operation name="getStatus"&gt; &lt;soap12:operation soapAction="urn:getStatus" style="document"/&gt; &lt;wsdl:input&gt; &lt;soap12:body use="literal"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output&gt; &lt;soap12:body use="literal"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;wsdl:operation name="StopMe"&gt; &lt;soap12:operation soapAction="urn:StopMe" style="document"/&gt; &lt;wsdl:input&gt; &lt;soap12:body use="literal"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output&gt; &lt;soap12:body use="literal"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;/wsdl:binding&gt; &lt;wsdl:binding name="MyServiceHttpBinding" type="ns:MyServicePortType"&gt; &lt;http:binding verb="POST"/&gt; &lt;wsdl:operation name="StartMe"&gt; &lt;http:operation location="MyService/StartMe"/&gt; &lt;wsdl:input&gt; &lt;mime:content type="text/xml" part="StartMe"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output&gt; &lt;mime:content type="text/xml" part="StartMe"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;wsdl:operation name="Configure"&gt; &lt;http:operation location="MyService/Configure"/&gt; &lt;wsdl:input&gt; &lt;mime:content type="text/xml" part="Configure"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output&gt; &lt;mime:content type="text/xml" part="Configure"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;wsdl:operation name="getStatus"&gt; &lt;http:operation location="MyService/getStatus"/&gt; &lt;wsdl:input&gt; &lt;mime:content type="text/xml" part="getStatus"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output&gt; &lt;mime:content type="text/xml" part="getStatus"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;wsdl:operation name="StopMe"&gt; &lt;http:operation location="MyService/StopMe"/&gt; &lt;wsdl:input&gt; &lt;mime:content type="text/xml" part="StopMe"/&gt; &lt;/wsdl:input&gt; &lt;wsdl:output&gt; &lt;mime:content type="text/xml" part="StopMe"/&gt; &lt;/wsdl:output&gt; &lt;/wsdl:operation&gt; &lt;/wsdl:binding&gt; &lt;wsdl:service name="MyService"&gt; &lt;wsdl:port name="MyServiceHttpSoap11Endpoint" binding="ns:MyServiceSoap11Binding"&gt; &lt;soap:address location="http://110.227.162.237:8080/WebServicePrototype/services/MyService.MyServiceHttpSoap11Endpoint/"/&gt; &lt;/wsdl:port&gt; &lt;wsdl:port name="MyServiceHttpSoap12Endpoint" binding="ns:MyServiceSoap12Binding"&gt; &lt;soap12:address location="http://110.227.162.237:8080/WebServicePrototype/services/MyService.MyServiceHttpSoap12Endpoint/"/&gt; &lt;/wsdl:port&gt; &lt;wsdl:port name="MyServiceHttpEndpoint" binding="ns:MyServiceHttpBinding"&gt; &lt;http:address location="http://110.227.162.237:8080/WebServicePrototype/services/MyService.MyServiceHttpEndpoint/"/&gt; &lt;/wsdl:port&gt; &lt;/wsdl:service&gt; </code></pre> <p></p> <p>I'm using : a) Eclipse: Ganymede/Galileo b) Tomcat 6.0 c) AXIS2 1.4.1</p> <p>Please help me out or let me know whether I'm missing some basic fundamentals. Any help is much appreciated. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload