package com.westat.ctsu.cews; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import java.security.Security; import com.westat.ctsu.cews.CewsResponse; import org.apache.axis.encoding.ser.BeanDeserializerFactory; import org.apache.axis.encoding.ser.BeanSerializerFactory; import javax.xml.namespace.QName; import javax.xml.rpc.ParameterMode; public class NodeTesterComplex { public static void main(String[] args) { NodeTesterComplex node = new NodeTesterComplex(); CewsResponse cewsResponse = node.invokeClient(); System.out.println("[ResponseStatusText] " + cewsResponse.getResponseStatusText()); System.out.println("[getResponseStatus] " + cewsResponse.getResponseStatus()); } public NodeTesterComplex() { } /** * Web Service Client * @return */ public static CewsResponse invokeClient() { String endPoint = "http://www3.ctsu.org/cews/services/rdtsTransactionRequest"; CewsResponse cewsResponse = new CewsResponse(); String result = ""; String groupCode = "SWOG"; int perCtepId = "999999"; String ownerCode = ""; try { System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); // Create a stub object Service service = new Service(); Call call = (Call)service.createCall(); QName qnResp = new QName("urn:com.westat.ctsu.cews", "CewsResponse"); call.registerTypeMapping(CewsResponse.class, qnResp, new BeanSerializerFactory(CewsResponse.class, qnResp), new BeanDeserializerFactory(CewsResponse.class, qnResp)); call.setTargetEndpointAddress(new java.net.URL(endPoint)); call.setReturnClass(com.westat.ctsu.cews.CewsResponse.class); call.addParameter("groupCode", org.apache.axis.encoding.XMLType.XSD_STRING, ParameterMode.IN); call.addParameter("perCtepId", org.apache.axis.encoding.XMLType.XSD_STRING, ParameterMode.IN); call.addParameter("ownerCode", org.apache.axis.encoding.XMLType.XSD_STRING, ParameterMode.IN); call.setReturnType(qnResp); call.setOperationName(new javax.xml.namespace.QName("requestRosterTxs")); OR call.setOperationName(new javax.xml.namespace.QName("requestRoleTxs")); OR call.setOperationName(new javax.xml.namespace.QName("requestContactTxs")); cewsResponse = (CewsResponse)call.invoke(new Object[] { groupCode, perCtepId, ownerCode }); if (cewsResponse != null) { System.out.println("CewsResponse object is not null"); } else { System.out.println("CewsResponse object is null"); } } catch (Exception ex) { System.out.println("[invokeClient] Exception: " + ex.toString()); result = ex.toString(); } return cewsResponse; } }