java service client for wsdl
hi ,
this my my very first thread on this forum.
Completely new bee in web services.
I am having the wsdl from some url abc.xyz.com/api/?wsdl(suppose) as:
<message name="call">
<part name="sessionId" type="xsd:string"/>
<part name="resourcePath" type="xsd:string"/>
<part name="args" type="xsd:anyType"/>
</message>
<message name="callResponse">
<part name="callReturn" type="xsd:anyType"/>
</message>
<portType name="Mage_Api_Model_Server_HandlerPortType">
<operation name="call">
<documentation>Call api functionality</documentation>
<input message="typens:call"/>
<output message="typens:callResponse"/>
</operation>
</portType >
<binding name="Mage_Api_Model_Server_HandlerBinding" type="typens:Mage_Api_Model_Server_HandlerPortType ">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="call">
<soapperation soapAction="urn:Mage_Api_Model_Server_HandlerActio n"/>
<input>
<soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body namespace="urn:Magento" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
This is what I have tried:
Created a new JAVA project from Eclipse wizard.
right click on the project navigate to web service-> web service client.
Give the service definition http://abc.xyz.com/api/?wsdl(suppose)
in configuration:
(a) server runtime:tomcat v7.0 server
(b) webservice runtime:apache axis
Choose test client from slider (I have also tried develop client a bit confuse,as I have to create client much confused)
Click on finish.
As a result I found web service test client browser with some method, input and result. Also I got some JAVA file in my resources folder:
Mage_Api_Model_Server_HandlerBindingStub
Mage_Api_Model_Server_HandlerPortType
Mage_Api_Model_Server_HandlerPortTypeProxy
MagentoService
MagentoServiceLocator
now how to write my client code in java some thing like this just a try :
Code :
package Magento;
public class MyClient {
public static void main(String[] args) {
try{
MagentoServiceLocator msl = new MagentoServiceLocator();
MagentoService ms = (MagentoService) msl.WHICH_METHOD_TO_CALL();
double product_list = ms.catalogProductList;
System.out.println("Product List: " + product_list);
} catch (Exception e) {
e.printStackTrace();
}
}
}
any help i have tried to the best of mine but not getting which method should i call for accessing a webservice?
thanks
Re: java service client for wsdl
I've moved this thread to a new forum for better topic alignment. Please read this for more information: http://www.javaprogrammingforums.com...e-posting.html
Re: java service client for wsdl
Getting/sending that from/to a webservice is not as easy as a System.out.printl() -- at least apparently, because of the SOAP messages' format. There must be done some mapping between data-types, packaging the messages etc ...and even though it might sound complicated, it's not, because there are libraries out there that will do the hard work for you, so consuming a webservice becomes a piece of cake. For starting, read about JAXWS JAX-WS Reference Implementation — Java.net .
application context
Re: java service client for wsdl
Hi,
I have a small question , how I ll set up in my eclipse for web service wsdl.
Can any one help.
Core java
Re: java service client for wsdl
Quote:
Originally Posted by
mr.miku
Hi,
I have a small question , how I ll set up in my eclipse for web service wsdl.
Can any one help.
If you have a question, post it in its own thread in the appropriate forum. Don't hijack another person's thread.
Re: java service client for wsdl
Hi KevinWorkman,
I have post it in this thread as I thought it is relevant .
OK for further I ll put it in a new thread.
Re: java service client for wsdl
Hi Upadhyay,
I'm also facing the same issue, did you find the solution, If yes please help me out. Expecting you reply.