0
votes

I'm new to web services. With all difficulty I have generated a simple 'Hello World' web service :D. I want to invoke the web service using java. The web service has a hard coded value shown as the output. Here is what I have tried.

  • I have created a new Dynamic web Project in Eclipse for web service client.
  • To this project generated stub classes for the web service using Axis2 and Eclipse.
  • I am not able to understand what the generated stub class basically contain, and how to use the stub class to invoke the webservice.
  • The stub class generated has too many lines of code. which i cannot paste it here; Is there any particular class that i need to concentrate on inorder to invoke a method in the webservice?

Part of the wsdl look like this

<wsdl:types>
 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://sample.com/Webservice/wsTest" targetNamespace="http://sample.com/Webservice/wsTest">
 <xsd:element name="test" type="tns:test"/>
 <xsd:element name="testResponse" type="tns:testResponse"/>
 <xsd:complexType name="test">
 <xsd:sequence></xsd:sequence>
 </xsd:complexType>
 <xsd:complexType name="testResponse">
<xsd:sequence>
        <xsd:element name="outputString" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
 </wsdl:types>
 <wsdl:message name="wsTest_PortType_test">
 <wsdl:part name="parameters" element="tns:test"></wsdl:part>
 </wsdl:message>

Could you please let me know how to invoke a web service using Java in eclipse.

Later part: In case my webservice has input(eg: web service for addition) how do i pass the request parameters and get an output as a response.

1

1 Answers

1
votes

I think this will definitely helps you

Just go through step by step procedure according to it,then you can achieve easily your Requirement.

the Link is here:

http://www.ibm.com/developerworks/webservices/library/ws-apacheaxis/index.html?ca=dat