Can anyone point me to Java webservice client sample?

Posted by jquerijero on 28-Jul-2009 15:14

The Progress Webservice runs in state-free mode and generated as RPC/Literal.

I'm looking for Java client sample code for the following scenarios (if supported);

1.  Service has a Dataset input anf output parameters ( strong-type and/or dataset handle)

2. Service has SubAppObjects.

Thanks,

All Replies

Posted by Admin on 29-Jul-2009 02:59

First download and install JavaAxis and document the OE webservice like this example ...

In thegenerated cede source you will find the class'es for Datasets ...

PJ=$(pwd);
CATALINA_HOME="/opt/jakarta-tomcat-5.5.9";
export CATALINA_HOME;
JAVA_HOME="/opt/jdk1.6.0_02";
export JAVA_HOME;
AXIS_PATH="$CATALINA_HOME/webapps/axis/WEB-INF/lib";
AXIS_CLASSPATH="$AXIS_PATH/axis.jar:$AXIS_PATH/commons-discovery-0.2.jar";
AXIS_CLASSPATH="$AXIS_CLASSPATH:$AXIS_PATH/commons-logging-1.0.4.jar:$AXIS_PATH/jaxrpc.jar";
AXIS_CLASSPATH="$AXIS_CLASSPATH:$AXIS_PATH/log4j-1.2.8.jar:$AXIS_PATH/saaj.jar:$AXIS_PATH/wsdl4j-1.5.1.jar";
PATH_ROOT="$(pwd)/WSClient";
OUTPUTPATH="$PATH_ROOT/src";
WEB_SERVICE="http://rs:25011/wsa/wsa1/wsdl?targetURI=urn:prgs:RPCEncoded"
cd $AXIS_PATH;
java -cp $AXIS_CLASSPATH org.apache.axis.wsdl.WSDL2Java -o $OUTPUTPATH $WEB_SERVICE;

here is a simple call example for a String ... is a start

/*Progress*/
import details.soap_fault.*;
import RPCEncoded.prgs.*;

public class TestService {


  public String SValidateCustomer (Integer iCustNum) throws Exception {

      WSTKRPCEncodedService  service = new WSTKRPCEncodedServiceLocator();
      URL   connectURL = new URL(service.getWSTKRPCEncodedObjAddress());
      WSTKRPCEncodedObjStub  validateCustomer =
      (WSTKRPCEncodedObjStub)service.getWSTKRPCEncodedObj(connectURL);

      try {
          StringHolder customerNameHolder = new StringHolder();
        StringHolder resultHolder = new StringHolder();
        validateCustomer.getCustomerName(iCustNum.intValue(),
          customerNameHolder);
              String customerName = new String(customerNameHolder.value);
        return customerName;
      }  catch (Exception e) {e.printStackTrace();}
        return null;
  } //SValidateCustomer

    public static void main(String[] args) {
           TestService tst = new TestService();
           try {
             String s;
               s = tst.SValidateCustomer (new Integer(5));
               System.out.println (s);
           }  catch (Exception e) {System.err.println(e.getMessage());}
    } //main

} //class

This thread is closed