[Gug-cvs] gug/gug/wsdl/src/hu/niif/grid/gug/sum Sum.java, NONE, 1.1 SumClient.java, NONE, 1.1 SumLo
Status: Planning
Brought to you by:
szferi
Update of /cvsroot/gug/gug/gug/wsdl/src/hu/niif/grid/gug/sum In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv780/gug/sum Added Files: Sum.java SumClient.java SumLocator.java SumPortType.java SumPortTypeProxy.java SumSOAPBindingStub.java Log Message: java sources for WSDL testing --- NEW FILE: SumClient.java --- package hu.niif.grid.gug.sum; public class SumClient { public static void main(String [] args) throws Exception { System.out.printf("start....\n"); Sum locator = new SumLocator(); SumPortType port = locator.getSumSOAPService(); String a = ""; try { a = port.sum("10", "20"); } catch(Exception e){ System.err.printf("Exception: %s", e); } System.out.printf("%s = %s + %s\n", a, "10", "20"); } } --- NEW FILE: SumPortType.java --- /** * SumPortType.java * * This file was auto-generated from WSDL * by the Apache Axis 1.3 Oct 05, 2005 (05:23:37 EDT) WSDL2Java emitter. */ package hu.niif.grid.gug.sum; public interface SumPortType extends java.rmi.Remote { public java.lang.String sum(java.lang.String a, java.lang.String b) throws java.rmi.RemoteException; } --- NEW FILE: SumSOAPBindingStub.java --- /** * SumSOAPBindingStub.java * * This file was auto-generated from WSDL * by the Apache Axis 1.3 Oct 05, 2005 (05:23:37 EDT) WSDL2Java emitter. */ package hu.niif.grid.gug.sum; public class SumSOAPBindingStub extends org.apache.axis.client.Stub implements hu.niif.grid.gug.sum.SumPortType { private java.util.Vector cachedSerClasses = new java.util.Vector(); private java.util.Vector cachedSerQNames = new java.util.Vector(); private java.util.Vector cachedSerFactories = new java.util.Vector(); private java.util.Vector cachedDeserFactories = new java.util.Vector(); static org.apache.axis.description.OperationDesc [] _operations; static { _operations = new org.apache.axis.description.OperationDesc[1]; _initOperationDesc1(); } private static void _initOperationDesc1(){ org.apache.axis.description.OperationDesc oper; org.apache.axis.description.ParameterDesc param; oper = new org.apache.axis.description.OperationDesc(); oper.setName("sum"); param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "a"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); oper.addParameter(param); param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "b"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false); oper.addParameter(param); oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); oper.setReturnClass(java.lang.String.class); oper.setReturnQName(new javax.xml.namespace.QName("", "Response")); oper.setStyle(org.apache.axis.constants.Style.RPC); oper.setUse(org.apache.axis.constants.Use.LITERAL); _operations[0] = oper; } public SumSOAPBindingStub() throws org.apache.axis.AxisFault { this(null); } public SumSOAPBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { this(service); super.cachedEndpoint = endpointURL; } public SumSOAPBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault { if (service == null) { super.service = new org.apache.axis.client.Service(); } else { super.service = service; } ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2"); } protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException { try { org.apache.axis.client.Call _call = super._createCall(); if (super.maintainSessionSet) { _call.setMaintainSession(super.maintainSession); } if (super.cachedUsername != null) { _call.setUsername(super.cachedUsername); } if (super.cachedPassword != null) { _call.setPassword(super.cachedPassword); } if (super.cachedEndpoint != null) { _call.setTargetEndpointAddress(super.cachedEndpoint); } if (super.cachedTimeout != null) { _call.setTimeout(super.cachedTimeout); } if (super.cachedPortName != null) { _call.setPortName(super.cachedPortName); } java.util.Enumeration keys = super.cachedProperties.keys(); while (keys.hasMoreElements()) { java.lang.String key = (java.lang.String) keys.nextElement(); _call.setProperty(key, super.cachedProperties.get(key)); } return _call; } catch (java.lang.Throwable _t) { throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t); } } public java.lang.String sum(java.lang.String a, java.lang.String b) throws java.rmi.RemoteException { if (super.cachedEndpoint == null) { throw new org.apache.axis.NoEndPointException(); } org.apache.axis.client.Call _call = createCall(); _call.setOperation(_operations[0]); _call.setUseSOAPAction(true); _call.setSOAPActionURI("http://gug.grid.niif.hu/sum/NewOperation"); _call.setEncodingStyle(null); _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE); _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setOperationName(new javax.xml.namespace.QName("http://gug.grid.niif.hu/sum", "sum")); setRequestHeaders(_call); setAttachments(_call); try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {a, b}); if (_resp instanceof java.rmi.RemoteException) { throw (java.rmi.RemoteException)_resp; } else { extractAttachments(_call); try { return (java.lang.String) _resp; } catch (java.lang.Exception _exception) { return (java.lang.String) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String.class); } } } catch (org.apache.axis.AxisFault axisFaultException) { throw axisFaultException; } } } --- NEW FILE: Sum.java --- /** * Sum.java * * This file was auto-generated from WSDL * by the Apache Axis 1.3 Oct 05, 2005 (05:23:37 EDT) WSDL2Java emitter. */ package hu.niif.grid.gug.sum; public interface Sum extends javax.xml.rpc.Service { public java.lang.String getSumSOAPServiceAddress(); public hu.niif.grid.gug.sum.SumPortType getSumSOAPService() throws javax.xml.rpc.ServiceException; public hu.niif.grid.gug.sum.SumPortType getSumSOAPService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; } --- NEW FILE: SumLocator.java --- /** * SumLocator.java * * This file was auto-generated from WSDL * by the Apache Axis 1.3 Oct 05, 2005 (05:23:37 EDT) WSDL2Java emitter. */ package hu.niif.grid.gug.sum; public class SumLocator extends org.apache.axis.client.Service implements hu.niif.grid.gug.sum.Sum { public SumLocator() { } public SumLocator(org.apache.axis.EngineConfiguration config) { super(config); } public SumLocator(java.lang.String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException { super(wsdlLoc, sName); } // Use to get a proxy class for SumSOAPService private java.lang.String SumSOAPService_address = "http://localhost:21111/Sum"; public java.lang.String getSumSOAPServiceAddress() { return SumSOAPService_address; } // The WSDD service name defaults to the port name. private java.lang.String SumSOAPServiceWSDDServiceName = "SumSOAPService"; public java.lang.String getSumSOAPServiceWSDDServiceName() { return SumSOAPServiceWSDDServiceName; } public void setSumSOAPServiceWSDDServiceName(java.lang.String name) { SumSOAPServiceWSDDServiceName = name; } public hu.niif.grid.gug.sum.SumPortType getSumSOAPService() throws javax.xml.rpc.ServiceException { java.net.URL endpoint; try { endpoint = new java.net.URL(SumSOAPService_address); } catch (java.net.MalformedURLException e) { throw new javax.xml.rpc.ServiceException(e); } return getSumSOAPService(endpoint); } public hu.niif.grid.gug.sum.SumPortType getSumSOAPService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException { try { hu.niif.grid.gug.sum.SumSOAPBindingStub _stub = new hu.niif.grid.gug.sum.SumSOAPBindingStub(portAddress, this); _stub.setPortName(getSumSOAPServiceWSDDServiceName()); return _stub; } catch (org.apache.axis.AxisFault e) { return null; } } public void setSumSOAPServiceEndpointAddress(java.lang.String address) { SumSOAPService_address = address; } /** * For the given interface, get the stub implementation. * If this service has no port for the given interface, * then ServiceException is thrown. */ public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { try { if (hu.niif.grid.gug.sum.SumPortType.class.isAssignableFrom(serviceEndpointInterface)) { hu.niif.grid.gug.sum.SumSOAPBindingStub _stub = new hu.niif.grid.gug.sum.SumSOAPBindingStub(new java.net.URL(SumSOAPService_address), this); _stub.setPortName(getSumSOAPServiceWSDDServiceName()); return _stub; } } catch (java.lang.Throwable t) { throw new javax.xml.rpc.ServiceException(t); } throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName())); } /** * For the given interface, get the stub implementation. * If this service has no port for the given interface, * then ServiceException is thrown. */ public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { if (portName == null) { return getPort(serviceEndpointInterface); } java.lang.String inputPortName = portName.getLocalPart(); if ("SumSOAPService".equals(inputPortName)) { return getSumSOAPService(); } else { java.rmi.Remote _stub = getPort(serviceEndpointInterface); ((org.apache.axis.client.Stub) _stub).setPortName(portName); return _stub; } } public javax.xml.namespace.QName getServiceName() { return new javax.xml.namespace.QName("http://gug.grid.niif.hu/sum", "Sum"); } private java.util.HashSet ports = null; public java.util.Iterator getPorts() { if (ports == null) { ports = new java.util.HashSet(); ports.add(new javax.xml.namespace.QName("http://gug.grid.niif.hu/sum", "SumSOAPService")); } return ports.iterator(); } /** * Set the endpoint address for the specified port name. */ public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException { if ("SumSOAPService".equals(portName)) { setSumSOAPServiceEndpointAddress(address); } else { // Unknown Port Name throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); } } /** * Set the endpoint address for the specified port name. */ public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException { setEndpointAddress(portName.getLocalPart(), address); } } --- NEW FILE: SumPortTypeProxy.java --- package hu.niif.grid.gug.sum; public class SumPortTypeProxy implements hu.niif.grid.gug.sum.SumPortType { private String _endpoint = null; private hu.niif.grid.gug.sum.SumPortType sumPortType = null; public SumPortTypeProxy() { _initSumPortTypeProxy(); } private void _initSumPortTypeProxy() { try { sumPortType = (new hu.niif.grid.gug.sum.SumLocator()).getSumSOAPService(); if (sumPortType != null) { if (_endpoint != null) ((javax.xml.rpc.Stub)sumPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); else _endpoint = (String)((javax.xml.rpc.Stub)sumPortType)._getProperty("javax.xml.rpc.service.endpoint.address"); } } catch (javax.xml.rpc.ServiceException serviceException) {} } public String getEndpoint() { return _endpoint; } public void setEndpoint(String endpoint) { _endpoint = endpoint; if (sumPortType != null) ((javax.xml.rpc.Stub)sumPortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint); } public hu.niif.grid.gug.sum.SumPortType getSumPortType() { if (sumPortType == null) _initSumPortTypeProxy(); return sumPortType; } public java.lang.String sum(java.lang.String a, java.lang.String b) throws java.rmi.RemoteException{ if (sumPortType == null) _initSumPortTypeProxy(); return sumPortType.sum(a, b); } } |