Seeking Example/Tutorial on using idempiere web services

599 views
Skip to first unread message

Robert Bui

unread,
Feb 22, 2014, 7:11:42 AM2/22/14
to idem...@googlegroups.com
Hello all,
   I am trying to import products to idempiere using web services from different file formats. As I am also new to web services and am very much lost. So far, I have sample code just trying to login in:


    public static void main(String[] args) {
            System.out.println("***********************");
            System.out.println("Create Web Service Client...");
            CompositeInterface service1 = new CompositeInterface();
            System.out.println("Create Web Service...");
            CompositeService port1 = service1.getCompositeServiceImplPort();
            System.out.println("Call Web Service Operation...");
           
            CompositeRequest compositeRequest = new CompositeRequest();
            ADLoginRequest aDLoginRequest = new ADLoginRequest();
           
            aDLoginRequest.setUser("myAdmin");
            aDLoginRequest.setPass("myAdmin");
            aDLoginRequest.setClientID(1000000);
            aDLoginRequest.setOrgID(1000000);
            aDLoginRequest.setRoleID(1000000);
            aDLoginRequest.setWarehouseID(0);
            aDLoginRequest.setStage(0);
            aDLoginRequest.setLang("en_AU");
            compositeRequest.setADLoginRequest(aDLoginRequest);
           
            System.out.println("Server said: " + port1.compositeOperation(compositeRequest));
            //Please input the parameters instead of 'null' for the upper method!
   
            System.out.println("Create Web Service...");
            CompositeService port2 = service1.getCompositeServiceImplPort();
            System.out.println("Call Web Service Operation...");
            System.out.println("Server said: " + port2.compositeOperation(null));
            //Please input the parameters instead of 'null' for the upper method!
   
            System.out.println("***********************");
            System.out.println("Call Over!");
    }


   I believe I have set all the parameters correct just trying to login . However, I keep getting:

Create Web Service Client...
Create Web Service...
Call Web Service Operation...
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Found element arg0 but could not find matching RPC/Literal part
    at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
    at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:111)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
    at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:135)
    at com.sun.proxy.$Proxy31.compositeOperation(Unknown Source)
    at org.idempiere.adinterface._1_0.clientsample.ClientSample.main(ClientSample.java:28)


    Any help on getting me started would be great - better still if there are examples on using the web services for iDempiere.

    Thanks.

Robert
Reply all
Reply to author
Forward
0 new messages