You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by Andrew Fielden <af...@tibco.com> on 2006/08/22 15:27:09 UTC
Simple example required
I've looked at the WSS4J examples, but still don't fully understand how
it fits together with calling a web service using Axis.
I'd like to be able to add SAML tokens to a SOAP message, but I have a
couple of basic questions:
1. The examples make use of a callback class to manipulate the SOAP
message. How is this callback class registered, in the context of the
example below.
2. The examples get a reference to the SOAP envelope object, but how do
I obtain this, in the context of the example below.
Thanks for any advice.
1 import org.apache.axis.client.Call;
2 import org.apache.axis.client.Service;
3 import javax.xml.namespace.QName;
4
5 public class TestClient {
6 public static void main(String [] args) {
7 try {
8 String endpoint =
9 "http://ws.apache.org:5049/axis/services/echo";
10
11 Service service = new Service();
12 Call call = (Call) service.createCall();
13
14 call.setTargetEndpointAddress( new java.net.URL(endpoint) );
15 call.setOperationName(new QName("http://soapinterop.org/",
echoString"));
16
17 String ret = (String) call.invoke( new Object[] { "Hello!" }
);
18
19 System.out.println("Sent 'Hello!', got '" + ret + "'");
20 } catch (Exception e) {
21 System.err.println(e.toString());
22 }
23 }
24 }
---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org