Archiveinträge für 4. Mai 2009
Montag, 4. Mai 2009
Websphere App Server: Add HTTP transport Header to a JAX-RPC Client Stub
com.ibm.websphere.webservices.Constants.REQUEST_TRANSPORT_PROPERTIES contains this string: com.ibm.websphere.webservices.requestTransportProperties
This constant is available since Webpshere App Server 6.0. It’s quite easy to add a HTTP transport header to a JAX-RPC-Client-Stub, look to this:
String endpoint = “http://localhost:8080/YOURAPP/services/YourService”;
java.net.URL endpoint = new URL(endpoint );
YourServiceLocator locator = new YourServiceLocator ();
YourService stub= locator.getYourService(endpointUrl);
java.util.HashMap sendTransportHeaders = new java.util.HashMap();
sendTransportHeaders.put(”Cookie”,”YourCookieName=YourCookieValue”);
// this is needed for basic authentication header:
((javax.xml.rpc.Stub) […]