我使用wsimport和jax-ws-ri生成了类。使用@requestwrapper和@responsewrapper,我无法访问实际的soap内容。我的目标是向soap头添加数字签名。
如何检索请求soap消息、提取soap正文并将内容插入soap头中?
这就是我目前所拥有的。
ServiceUser serviceUser = new ServiceUser(new URL(wsdlUrl));
ServiceUserSoap service = serviceUser.getServiceUserSoap();
int soapTimeOut = 5;
((BindingProvider) service).getRequestContext().put(Constants.RESPONSE_TIMEOUT_PROPERTY,
Integer.toString((soapTimeOut))); // Timeout in seconds
((BindingProvider) service).getRequestContext().put(Constants.CONNECTION_TIMEOUT_PROPERTY,
Integer.toString((soapTimeOut))); // Timeout in seconds
retRec = service.getRecords(active, user);
@WebMethod(action = "http://www.server.com/userlist/getRecords")
@WebResult(name = "getRecordsResult", targetNamespace = "")
@RequestWrapper(localName = "getRecords", targetNamespace = "http://www.server.com/userlist", className = "com.wsclient.api.GetRecords")
@ResponseWrapper(localName = "getRecordsResponse", targetNamespace = "http://www.server.com/userlist", className = "com.wsclient.api.GetRecordsResponse")
public List<com.userlist.api.GetRecordsResponse.GetRecordsResult> getRecords(
@WebParam(name = "u_active", targetNamespace = "")
Boolean active,
@WebParam(name = "u_user", targetNamespace = "")
String user);
}
暂无答案!
目前还没有任何答案,快来回答吧!