You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Nitin Dubey <Ni...@sos.sungard.com> on 2007/01/17 07:24:14 UTC
AXIS Client SSL with WebService
Hello,
I am trying to write a SSL client using AXIS 1.4. I got a sample from
net and able to run the following program successfully. I have to
modify the SOAP header and send a big XML content to a external
WebService. Can anybody tell me whether I am following the right
approach? And using the following code how do I modify the SOAP headers?
public static void main(String [] args) {
try {
// String endpoint =
"https://localhost:1000/axis/protected/EchoService.jws";
String endpoint =
"https://pc1267.ascindia.com:1000/axis/protected/EchoService.jws";
System.setProperty("javax.net.ssl.trustStore",
"C:/temp/ssl/.keystore");
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("echoString"));
// call.setUsername("wsuser");
// call.setPassword("wspwd");
String ret = (String) call.invoke( new Object[] { "Hello!" } );
System.out.println("Sent 'Hello!', got '" + ret + "'");
} catch (Exception e) {
System.err.println(e.toString());
}
Your any kind of help will be appreciated,
Nitin