1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
| package mypackage1;
import oracle.soap.transport.http.OracleSOAPHTTPConnection;
import org.apache.soap.encoding.SOAPMappingRegistry;
import java.net.URL;
import org.apache.soap.rpc.Call;
import org.apache.soap.Constants;
import java.util.Vector;
import org.apache.soap.rpc.Parameter;
import org.apache.soap.rpc.Response;
import org.apache.soap.Fault;
import org.apache.soap.SOAPException;
import java.util.Properties;
/**
* Generated by the Oracle JDeveloper 10g Web Services Stub/Skeleton Generator.
* Date Created: Wed Mar 02 15:54:48 CET 2011
* WSDL URL: http://localhost:8080/axis2/services/MainAppliService?wsdl
*/
public class MainAppliServiceStub
{
public MainAppliServiceStub()
{
m_httpConnection = new OracleSOAPHTTPConnection();
m_smr = new SOAPMappingRegistry();
}
public static void main(String[] args)
{
try
{
MainAppliServiceStub stub = new MainAppliServiceStub();
// Add your own code here.
String res = stub.lancement("", "", "", "11", "", "", "", "", "", true);
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
private String _endpoint = "http://localhost:8080/axis/services/MainAppliService/";
public String getEndpoint()
{
return _endpoint;
}
public void setEndpoint(String endpoint)
{
_endpoint = endpoint;
}
private OracleSOAPHTTPConnection m_httpConnection = null;
private SOAPMappingRegistry m_smr = null;
public String lancement(String mat, String n, String pre, String bu, String cf, String nomFic, String dd, String df, String txd, Boolean lancExc) throws Exception
{
String returnVal = null;
URL endpointURL = new URL(_endpoint);
Call call = new Call();
call.setSOAPTransport(m_httpConnection);
call.setTargetObjectURI("http://examples.ss.poi.apache.org");
call.setMethodName("lancement");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
Vector params = new Vector();
params.addElement(new Parameter("mat", String.class, mat, null));
params.addElement(new Parameter("n", String.class, n, null));
params.addElement(new Parameter("pre", String.class, pre, null));
params.addElement(new Parameter("bu", String.class, bu, null));
params.addElement(new Parameter("cf", String.class, cf, null));
params.addElement(new Parameter("nomFic", String.class, nomFic, null));
params.addElement(new Parameter("dd", String.class, dd, null));
params.addElement(new Parameter("df", String.class, df, null));
params.addElement(new Parameter("txd", String.class, txd, null));
params.addElement(new Parameter("lancExc", Boolean.class, lancExc, null));
call.setParams(params);
call.setSOAPMappingRegistry(m_smr);
Response response = call.invoke(endpointURL, "");
if (!response.generatedFault())
{
Parameter result = response.getReturnValue();
returnVal = (String)result.getValue();
}
else
{
Fault fault = response.getFault();
throw new SOAPException(fault.getFaultCode(), fault.getFaultString());
}
return returnVal;
}
public void setMaintainSession(boolean maintainSession)
{
m_httpConnection.setMaintainSession(maintainSession);
}
public boolean getMaintainSession()
{
return m_httpConnection.getMaintainSession();
}
public void setTransportProperties(Properties props)
{
m_httpConnection.setProperties(props);
}
public Properties getTransportProperties()
{
return m_httpConnection.getProperties();
}
} |
Partager