WSDL - One way operations

I am trying to create a webservice using Axis2 which has a method with no parameter. This method does not accept a parameter but returns a value.

Please refer to "getAllResumeIds" operation. The below WSDL gives me a warning "WS-I: (BP2208) wsdl:operation was not a request/response or one-way operation". Also the code generation from this WSDL fails.

Can someone please let me know how to resolve this?

Thank you
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
	xmlns:tns="http://www.examples.com/wsdl/ResumeService.wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ResumeService"
	targetNamespace="http://www.examples.com/wsdl/ResumeService.wsdl">
	<wsdl:types>
		<xsd:schema targetNamespace="http://www.examples.com/wsdl/ResumeService.wsdl">
			<xsd:element name="getResumeId">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="firstName" type="xsd:string" />
						<xsd:element name="lastName" type="xsd:string"></xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="getResumeIdResponse">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="resumeId" type="xsd:string" />
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="getResumeDetails">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="resumeId" type="xsd:string"></xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="getResumeDetailsResponse">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="firstName" type="xsd:string"></xsd:element>
						<xsd:element name="lastName" type="xsd:string"></xsd:element>
						<xsd:element name="address" type="tns:addressType"></xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>

			<xsd:complexType name="addressType">
			            <xsd:sequence>      
                              <xsd:element name="city" type="xsd:string" />      
                              <xsd:element name="state" type="xsd:string" />
                              <xsd:element name="country" type="xsd:string" />
                              <xsd:element name="mobile" type="xsd:string" />
                              <xsd:element name="email" type="xsd:string" />
                        </xsd:sequence>    			
			</xsd:complexType>
			
			<xsd:element name="getResumeIdsResponse">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="resumeIds" type="xsd:string" />   						
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
	

		</xsd:schema>
	</wsdl:types>
	<wsdl:message name="getResumeIdRequest">
		<wsdl:part element="tns:getResumeId" name="parameters" />
	</wsdl:message>
	<wsdl:message name="getResumeIdResponse">
		<wsdl:part element="tns:getResumeIdResponse" name="parameters" />
	</wsdl:message>
	<wsdl:message name="getResumeDetailsRequest">
		<wsdl:part name="parameters" element="tns:getResumeDetails"></wsdl:part>
	</wsdl:message>
	<wsdl:message name="getResumeDetailsResponse">
		<wsdl:part name="parameters" element="tns:getResumeDetailsResponse"></wsdl:part>
	</wsdl:message>
	<wsdl:message name="getResumeIdsResponse">
		<wsdl:part name="parameters" element="tns:getResumeIdsResponse"></wsdl:part>
	</wsdl:message>
	<wsdl:portType name="ResumeService">
		<wsdl:operation name="getResumeId">
			<wsdl:input message="tns:getResumeIdRequest" />
			<wsdl:output message="tns:getResumeIdResponse" />
		</wsdl:operation>
		<wsdl:operation name="getResumeDetails">
			<wsdl:input message="tns:getResumeDetailsRequest"></wsdl:input>
			<wsdl:output message="tns:getResumeDetailsResponse"></wsdl:output>
		</wsdl:operation>
		<wsdl:operation name="getAllResumeIds">		
			<wsdl:output message="tns:getResumeIdsResponse"></wsdl:output>
		</wsdl:operation>
	</wsdl:portType>
	<wsdl:binding name="ResumeServiceSOAP" type="tns:ResumeService">
		<soap:binding style="document"
			transport="http://schemas.xmlsoap.org/soap/http" />
		<wsdl:operation name="getResumeId">
			<soap:operation
				soapAction="http://www.examples.com/wsdl/ResumeService.wsdl/getResumeId" />
			<wsdl:input>
				<soap:body use="literal" />
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal" />
			</wsdl:output>
		</wsdl:operation>
		<wsdl:operation name="getResumeDetails">
			<soap:operation
				soapAction="http://www.examples.com/wsdl/ResumeService.wsdl/getResumeDetails" />
			<wsdl:input>
				<soap:body use="literal" />
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal" />
			</wsdl:output>
		</wsdl:operation>
		<wsdl:operation name="getAllResumeIds">
			<soap:operation soapAction="http://www.examples.com/wsdl/ResumeService.wsdl/getAllResumeIds" />			
			<wsdl:output>
				<soap:body use="literal" />
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	<wsdl:service name="ResumeService">
		<wsdl:port binding="tns:ResumeServiceSOAP" name="ResumeServiceSOAP">
			<soap:address location="http://www.example.org/" />
		</wsdl:port>
	</wsdl:service>
</wsdl:definitions>

Open in new window

ank9Asked:
Who is Participating?
 
Pramod KumarConnect With a Mentor Commented:
In the above way, the request packet will be:

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservice.pk.com">
   <soapenv:Header/>
   <soapenv:Body>
      <web:getAllResumeIds soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
   </soapenv:Body>
</soapenv:Envelope>
0
 
Pramod KumarCommented:
The request package for is as below:
You can see actually resumeIds is needed.


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:res="http://www.examples.com/wsdl/ResumeService.wsdl">
   <soapenv:Header/>
   <soapenv:Body>
      <res:getResumeIdsResponse>
         <resumeIds>?</resumeIds>
      </res:getResumeIdsResponse>
   </soapenv:Body>
</soapenv:Envelope>
0
 
ank9Author Commented:
Thanks for replying.
Can you please let me know how to correct this WSDL, so that "getAllResumeIds" operation accepts no parameter but returns a String array.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Pramod KumarCommented:
can you send me the java web-service method getAllResumeIds()
also, the axis config file.

By the way which axis version you are working with?
0
 
ank9Author Commented:
I am yet to implement the Java method. I am writing the WSDL and then using eclipse plugin will generate the skeleton (from this wsdl).
I am using axis2-1.5
 
My wsdl is as follows
 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
	xmlns:tns="http://www.examples.com/wsdl/ResumeService.wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ResumeService"
	targetNamespace="http://www.examples.com/wsdl/ResumeService.wsdl">
	<wsdl:types>
		<xsd:schema targetNamespace="http://www.examples.com/wsdl/ResumeService.wsdl">
			<xsd:element name="getResumeId">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="firstName" type="xsd:string" />
						<xsd:element name="lastName" type="xsd:string"></xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="getResumeIdResponse">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="resumeId" type="xsd:string" />
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="getResumeDetails">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="resumeId" type="xsd:string"></xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="getResumeDetailsResponse">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="firstName" type="xsd:string"></xsd:element>
						<xsd:element name="lastName" type="xsd:string"></xsd:element>
						<xsd:element name="address" type="tns:addressType"></xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>

			<xsd:complexType name="addressType">
				<xsd:sequence>
					<xsd:element name="city" type="xsd:string" />
					<xsd:element name="state" type="xsd:string" />
					<xsd:element name="country" type="xsd:string" />
					<xsd:element name="mobile" type="xsd:string" />
					<xsd:element name="email" type="xsd:string" />
				</xsd:sequence>
			</xsd:complexType>

			<xsd:element name="getResumeIdsResponse">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="resumeIds" type="xsd:string" maxOccurs="unbounded" />
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>

			<xsd:element name="updateResumeDetails">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="resumeId" type="xsd:string"></xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="updateResumeDetailsResponse">
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="updateStatus" type="xsd:boolean"></xsd:element>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>

		</xsd:schema>
	</wsdl:types>
	<wsdl:message name="getResumeIdRequest">
		<wsdl:part element="tns:getResumeId" name="parameters" />
	</wsdl:message>
	<wsdl:message name="getResumeIdResponse">
		<wsdl:part element="tns:getResumeIdResponse" name="parameters" />
	</wsdl:message>
	<wsdl:message name="getResumeDetailsRequest">
		<wsdl:part name="parameters" element="tns:getResumeDetails"></wsdl:part>
	</wsdl:message>
	<wsdl:message name="getResumeDetailsResponse">
		<wsdl:part name="parameters" element="tns:getResumeDetailsResponse"></wsdl:part>
	</wsdl:message>
	<wsdl:message name="getResumeIdsResponse">
		<wsdl:part name="parameters" element="tns:getResumeIdsResponse"></wsdl:part>
	</wsdl:message>

	<wsdl:message name="updateResumeDetailsRequest">
		<wsdl:part name="parameters" element="tns:updateResumeDetails"></wsdl:part>
	</wsdl:message>
	<wsdl:message name="updateResumeDetailsResponse">
		<wsdl:part name="parameters" element="tns:updateResumeDetailsResponse"></wsdl:part>
	</wsdl:message>

	<wsdl:portType name="ResumeService">
		<wsdl:operation name="getResumeId">
			<wsdl:input message="tns:getResumeIdRequest" />
			<wsdl:output message="tns:getResumeIdResponse" />
		</wsdl:operation>
		<wsdl:operation name="getResumeDetails">
			<wsdl:input message="tns:getResumeDetailsRequest"></wsdl:input>
			<wsdl:output message="tns:getResumeDetailsResponse"></wsdl:output>
		</wsdl:operation>
		
			<wsdl:operation name="getAllResumeIds"> <wsdl:output
			message="tns:getResumeIdsResponse"></wsdl:output> </wsdl:operation>
		
		<wsdl:operation name="updateResumeDetails">
			<wsdl:input message="tns:updateResumeDetailsRequest"></wsdl:input>
			<wsdl:output message="tns:updateResumeDetailsResponse"></wsdl:output>
		</wsdl:operation>
	</wsdl:portType>
	<wsdl:binding name="ResumeServiceSOAP" type="tns:ResumeService">
		<soap:binding style="document"
			transport="http://schemas.xmlsoap.org/soap/http" />
		<wsdl:operation name="getResumeId">
			<soap:operation
				soapAction="http://www.examples.com/wsdl/ResumeService.wsdl/getResumeId" />
			<wsdl:input>
				<soap:body use="literal" />
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal" />
			</wsdl:output>
		</wsdl:operation>
		<wsdl:operation name="getResumeDetails">
			<soap:operation
				soapAction="http://www.examples.com/wsdl/ResumeService.wsdl/getResumeDetails" />
			<wsdl:input>
				<soap:body use="literal" />
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal" />
			</wsdl:output>
		</wsdl:operation>
		
		<wsdl:operation name="getAllResumeIds"> <soap:operation
			soapAction="http://www.examples.com/wsdl/ResumeService.wsdl/getAllResumeIds"
			/> <wsdl:output> <soap:body use="literal" /> </wsdl:output>
		</wsdl:operation>
				<wsdl:operation name="updateResumeDetails">
			<soap:operation
				soapAction="http://www.examples.com/wsdl/ResumeService.wsdl/updateResumeDetails" />
			<wsdl:input>
				<soap:body use="literal" />
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal" />
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	<wsdl:service name="ResumeService">
		<wsdl:port binding="tns:ResumeServiceSOAP" name="ResumeServiceSOAP">
			<soap:address location="http://www.example.org/" />
		</wsdl:port>
	</wsdl:service>
</wsdl:definitions>

Open in new window

0
 
Pramod KumarCommented:
I am sure, eclipse plugin will generate java for calling web-methods exists on server.

See the logic on SERVER
====================
1) In java we have some public methods which have some business logic
2) we want to exposed these methods to outer world which can be accessed over invernet via SOAP (xml communicaton)
3) for this we deploy this code on the server by giving details of what method need to be exposed

Login on client (to absorb the we service method deployed on server
=================================================
1) We hit the browser by giving web service url and get the WSDL. This WSDL have all the structure of the exposed method(name of method, paramter name, type, return type etc) But not the business logic.
2) There are a number of way to call the web service. You are using some plugin. This plugin will generate some new java files which will help you to call those server methods.

So, if you want to chnage the return type, parameter etc., then you need to change the server code. And same i am asking...
If you have only WSDL and not the server access, the you won't be able to change those things.


0
 
ank9Author Commented:
I am following contract first approach not the code first approach. First I need to finalize the WSDL, then based on this WSDL eclipse code generator plugin will generate the Java skeletons. Then I'll put my business logic in these skeletons,
 
0
 
Pramod KumarCommented:
what will be the return type of getAllResumeIds(). an object or anything else?
0
 
ank9Author Commented:
A String Array
0
 
Pramod KumarCommented:
Attached is the sample WSDL for method like:

    public String[] getAllResumeIds(){
        .....
        return ....;
    }

=====================================

<?xml version="1.0" encoding="UTF-8" ?> 
- <wsdl:definitions targetNamespace="http://localhost:8080/olt/services/TEST" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://localhost:8080/olt/services/TEST" xmlns:intf="http://localhost:8080/olt/services/TEST" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <!-- 
WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)

  --> 
- <wsdl:types>
- <schema targetNamespace="http://localhost:8080/olt/services/TEST" xmlns="http://www.w3.org/2001/XMLSchema">
  <import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> 
- <complexType name="ArrayOf_xsd_string">
- <complexContent>
- <restriction base="soapenc:Array">
  <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]" /> 
  </restriction>
  </complexContent>
  </complexType>
  </schema>
  </wsdl:types>
- <wsdl:message name="getAllResumeIdsResponse">
  <wsdl:part name="getAllResumeIdsReturn" type="impl:ArrayOf_xsd_string" /> 
  </wsdl:message>
  <wsdl:message name="getAllResumeIdsRequest" /> 
- <wsdl:portType name="TestWS">
- <wsdl:operation name="getAllResumeIds">
  <wsdl:input message="impl:getAllResumeIdsRequest" name="getAllResumeIdsRequest" /> 
  <wsdl:output message="impl:getAllResumeIdsResponse" name="getAllResumeIdsResponse" /> 
  </wsdl:operation>
  </wsdl:portType>
- <wsdl:binding name="TESTSoapBinding" type="impl:TestWS">
  <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /> 
- <wsdl:operation name="getAllResumeIds">
  <wsdlsoap:operation soapAction="" /> 
- <wsdl:input name="getAllResumeIdsRequest">
  <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://webservice.pk.com" use="encoded" /> 
  </wsdl:input>
- <wsdl:output name="getAllResumeIdsResponse">
  <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/olt/services/TEST" use="encoded" /> 
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
- <wsdl:service name="TestWSService">
- <wsdl:port binding="impl:TESTSoapBinding" name="TEST">
  <wsdlsoap:address location="http://localhost:8080/olt/services/TEST" /> 
  </wsdl:port>
  </wsdl:service>
  </wsdl:definitions>

Open in new window

0
All Courses

From novice to tech pro — start learning today.