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 :
any help i have tried to the best of mine but not getting which method should i call for accessing a webservice?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(); } } }
thanks