How to use Service, ServiceLocator, portType, porttypeProxy and a stub to create a java client

I used the axial web service web service wizard + created a client slider to generate files like:

  • Mage_Api_Model_Server_HandlerBindingStub
  • Mage_Api_Model_Server_HandlerPortType
  • Mage_Api_Model_Server_HandlerPortTypeProxy
  • MagentoService
  • MagentoServiceLocator see my message

I am trying to make the client something like this:

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 that I tried my best but don’t get which method should I call to access the php webservice method. any help?

0
source share
1 answer

Create a client for this wsdl and try the following:

WebServiceSoapBindingStub stub = new WebServiceSoapBindingStub();
stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, wsdlUrl); 
WebService service = (WebService) stub;
service.authenticateUser(username,password); //service.yourservicename

Additional information to help you.

http://www.codeproject.com/KB/java/edujini_webservice_java.aspx

0

All Articles