Java SOAP Client
Java SOAP Client PDF Print E-mail

Download vm_soap_client.jar for java.

edit soa_for_vm.properties

add login/password/url

login=admin
password=adminpassword
url_users=http://yourURL/administrator/components/com_vm_soa/services/VM_UsersWSDL.php 
url_categories=http://yourURL/administrator/components/com_vm_soa/services/VM_CategoriesWSDL.php 
url_products=http://yourURL/administrator/components/com_vm_soa/services/VM_ProductWSDL.php 
url_orders=http://yourURL/administrator/components/com_vm_soa/services/VM_OrderWSDL.php 
url_sqlqueries=http://yourURL/administrator/components/com_vm_soa/services/VM_SQLQueriesWSDL.php  

Execute TestClass:

  
java -cp "vm_soap_client-1.0.0.jar" net.virtuemart.soapclient.VM_WebServicesTest  

Sample code for calling GetAllCategories :

  
//import  
import net.virtuemart.soapclient.VM_WebServicesClient;
import net.virtuemart.vm_categories.Categorie;
import net.virtuemart.vm_categories.CategorieArray; 
import net.virtuemart.vm_categories.GetAllCategoriesInput; 
import net.virtuemart.vm_categories.LoginInfo; 
import net.virtuemart.vm_categories.VMCategories_Service;  

//code 

VM_WebServicesClient virtuemartServices = new VM_WebServicesClient(); 

//get service for categories management  

VMCategories_Service catService = virtuemartServices.getCategoriesService(); 

//input parameters  GetAllCategoriesInput input = new GetAllCategoriesInput(); 

LoginInfo login= new LoginInfo(); login.setLogin(Global.LOGIN); 
login.setPassword(Global.PASSWORD); 
input.setLoginInfo(login);

//call 

WebService  CategorieArray catColl = catService.getVMCategoriesSOAP().getAllCategories(input);

//print response  

for (Categorie cat : catColl.getCategorie()){
       System.out.println("category : "+cat.getName()+" | id : "+cat.getId()); 
}  

 

Follow us on Facebook & Twitter



  

Useful informations

Itunes / Online store / Forum / FAQS / Contacts / About Us / Terms of Service