Axis2:
Session:_operationClient.getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.HEADER_COOKIE, strCookie);
_operationClient.getOptions().setManageSession(true);
Axis2 压缩 Gzip:
_operationClient.getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.MC_ACCEPT_GZIP, Boolean.TRUE);
WSIT:
Service s = new Service();
BindingProvider bt = (BindingProvider) s.getWSHttpBindingIService();
bt.getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
IService t = (IService) bt;
String str = t.doWork("aa1");
System.out.println(str);
Headers headers = (Headers) bt.getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS);
Headers headersForRequest = new Headers();
Iterator<String> iterator = headers.keySet().iterator();
for(; iterator.hasNext();)
{
String key = iterator.next();
List<String> value = headers.get(key);
System.out.println(key);
System.out.println(value);
System.out.println("----");
if(key != null)
{
if(key.toLowerCase().equals("set-cookie"))
{
key = "cookie";
}
headersForRequest.put(key, value);
}
}
String str2 = t.doWork("aa2");
System.out.println(str2);
Service2 ss = new Service2();
BindingProvider btt = (BindingProvider) ss.getWSHttpBindingIService2();
btt.getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
btt.getRequestContext().put(MessageContext.HTTP_REQUEST_HEADERS, headersForRequest);
IService2 tt = (IService2) btt;
String vstr = tt.doWork("aabb1");
System.out.println(vstr);
String vstr2 = tt.doWork("aabb2");
System.out.println(vstr2);
// XWSSecurityConfiguration.MESSAGE_SECURITY_CONFIGURATION;