Soap 如何使用从wsdl生成的jaxws wsimport发送saml请求
请告诉我我做错了什么。 这里是我运行此代码后得到的错误 com.sun.xml.internal.ws.fault.ServerSOAPFaultException:客户端从服务器接收到SOAP错误:客户端错误请查看服务器日志以查找有关故障确切原因的更多详细信息Soap 如何使用从wsdl生成的jaxws wsimport发送saml请求,soap,wsdl,saml,Soap,Wsdl,Saml,请告诉我我做错了什么。 这里是我运行此代码后得到的错误 com.sun.xml.internal.ws.fault.ServerSOAPFaultException:客户端从服务器接收到SOAP错误:客户端错误请查看服务器日志以查找有关故障确切原因的更多详细信息 SecurityTokenService service = new SecurityTokenService(); SecurityTokenServicePortTypeIssue port = se
SecurityTokenService service = new SecurityTokenService();
SecurityTokenServicePortTypeIssue port = service.getISTSIssue();
// TODO initialize WS operation arguments here
RequestSecurityTokenType issueRequest = new RequestSecurityTokenType();
LifetimeType lifetime = new LifetimeType();
/*
* Derive the token creation date and time. Use a GregorianCalendar to establish the current time, then use a DatatypeFactory to map the time data to XML. */
DatatypeFactory dtFactory = DatatypeFactory.newInstance();
GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
XMLGregorianCalendar xmlCalendar = dtFactory.newXMLGregorianCalendar(cal);
AttributedDateTime created = new AttributedDateTime();
created.setValue(xmlCalendar.toXMLFormat());
/*
* Specify a time interval for token expiration (specified in milliseconds).
*/
AttributedDateTime expires = new AttributedDateTime();
xmlCalendar.add(dtFactory.newDuration(30 * 60 * 1000));
expires.setValue(xmlCalendar.toXMLFormat());
/*
* Set the created and expires fields in the lifetime object.
*/
lifetime.setCreated(created);
lifetime.setExpires(expires);
/*
* Set the token request fields.
*/
issueRequest.setTokenType("http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0");
issueRequest.setRequestType("http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue");
issueRequest.setLifetime(lifetime);
RequestSecurityTokenResponseType result = port.issueRST(issueRequest);
System.out.println("Result = " + result);
} catch (Exception ex) {
System.out.println(ex);
}