SOAPFaultException:WSS1601:未满足安全要求
SOAPFaultException: WSS1601: Security Requirements not met
我有一个 Web 服务客户端(在部署在 tomcat 6 上的 Java 应用程序项目中)。直到几天前端点已更改时一切正常。
Endpoints 需要访问 WSDL 的基本身份验证和执行服务的基本身份验证。
我正在使用 netbeans,我创建了一个 Web 服务客户端,我在其中指定了 wsdl url,netbeans 需要 username/password 来生成代码。执行代码时,这是错误
19-gen-2017 20.24.25 com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient createMessage
GRAVE: WSS1601: Security Requirements not met - Transport binding configured in policy but incoming message was not SSL enabled
19-gen-2017 20.24.25 com.sun.xml.wss.jaxws.impl.SecurityClientTube processClientResponsePacket
GRAVE: WSSTUBE0025: Error in Verifying Security in the Inbound Message.
com.sun.xml.wss.XWSSecurityException: WSS1601: Security Requirements not met - Transport binding configured in policy but incoming message was not SSL enabled
20:24:25:360 - ERROR - - Stacktrace:
javax.xml.ws.WebServiceException: WSSTUBE0025: Error in Verifying Security in the Inbound Message.
at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.createMessage(SecurityRecipient.java:973)
at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processClientResponsePacket(SecurityClientTube.java:417)
at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.validateMessage(SecurityRecipient.java:230)
at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processResponse(SecurityClientTube.java:345)
at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.verifyInboundMessage(SecurityTubeBase.java:462)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:639)
at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processClientResponsePacket(SecurityClientTube.java:412)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588)
at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processResponse(SecurityClientTube.java:345)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:639)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:470)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588)
at com.sun.xml.ws.client.Stub.process(Stub.java:319)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:470)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:157)
at com.sun.xml.ws.client.Stub.process(Stub.java:319)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:109)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:157)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:109)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:140)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:140)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.xml.ws.soap.SOAPFaultException: WSS1601: Security Requirements not met - Transport binding configured in policy but incoming message was not SSL enabled
at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.getSOAPFaultException(SecurityTubeBase.java:674)
at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.getSOAPFaultException(SecurityTubeBase.java:692)
... 33 more
Caused by: com.sun.xml.wss.impl.WssSoapFaultException: WSS1601: Security Requirements not met - Transport binding configured in policy but incoming message was not SSL enabled
at com.sun.xml.wss.impl.SecurableSoapMessage.newSOAPFaultException(SecurableSoapMessage.java:336)
at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.getSOAPFaultException(SecurityTubeBase.java:688)
... 33 more
Caused by: com.sun.xml.wss.XWSSecurityException: WSS1601: Security Requirements not met - Transport binding configured in policy but incoming message was not SSL enabled
at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.createMessage(SecurityRecipient.java:973)
at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.validateMessage(SecurityRecipient.java:230)
at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.verifyInboundMessage(SecurityTubeBase.java:462)
at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processClientResponsePacket(SecurityClientTube.java:412
这是 WSDL 文件(出于隐私原因删除了一些名称)
<?xml version="1.0" encoding="utf-8"?><wsdl:definitions targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsoap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:n1="urn:sap-com:document:sap:rfc:functions"><wsdl:documentation><sidl:sidl xmlns:sidl="http://www.sap.com/2007/03/sidl"/></wsdl:documentation><wsp:UsingPolicy wsdl:required="true"/><wsp:Policy wsu:Id=""><wsp:ExactlyOne><wsp:All><sapattahnd:Enabled xmlns:sapattahnd="http://www.sap.com/710/features/attachment/">false</sapattahnd:Enabled><saptrnbnd:OptimizedMimeSerialization xmlns:saptrnbnd="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization" wsp:Optional="true"/><wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsp:Optional="true"/><wsp:All xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sp:HttpBasicAuthentication/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All><wsp:All><sapattahnd:Enabled xmlns:sapattahnd="http://www.sap.com/710/features/attachment/">false</sapattahnd:Enabled><saptrnbnd:OptimizedMimeSerialization xmlns:saptrnbnd="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization" wsp:Optional="true"/><wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsp:Optional="true"/><wsp:All xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sapsp:HTTPSSO2 SAPClient="" SID=""/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All><wsp:All><sapattahnd:Enabled xmlns:sapattahnd="http://www.sap.com/710/features/attachment/">false</sapattahnd:Enabled><saptrnbnd:OptimizedXMLTransfer uri="" xmlns:saptrnbnd="http://www.sap.com/webas/710/soap/features/transportbinding/" wsp:Optional="true"/><wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsp:Optional="true"/><wsp:All xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sp:HttpBasicAuthentication/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All><wsp:All><sapattahnd:Enabled xmlns:sapattahnd="http://www.sap.com/710/features/attachment/">false</sapattahnd:Enabled><saptrnbnd:OptimizedXMLTransfer uri="http://xml.sap.com/2006/11/esi/esp/binxml" xmlns:saptrnbnd="http://www.sap.com/webas/710/soap/features/transportbinding/" wsp:Optional="true"/><wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsp:Optional="true"/><wsp:All xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sapsp:HTTPSSO2 SAPClient="" SID=""/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All></wsp:ExactlyOne></wsp:Policy><wsp:Policy wsu:Id=""><wsp:ExactlyOne><wsp:All><sapattahnd:Enabled xmlns:sapattahnd="http://www.sap.com/710/features/attachment/">false</sapattahnd:Enabled><saptrnbnd:OptimizedMimeSerialization xmlns:saptrnbnd="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization" wsp:Optional="true"/><wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsp:Optional="true"/><wsp:All xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sp:HttpBasicAuthentication/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All><wsp:All><sapattahnd:Enabled xmlns:sapattahnd="http://www.sap.com/710/features/attachment/">false</sapattahnd:Enabled><saptrnbnd:OptimizedMimeSerialization xmlns:saptrnbnd="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization" wsp:Optional="true"/><wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsp:Optional="true"/><wsp:All xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sapsp:HTTPSSO2 SAPClient="" SID=""/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All><wsp:All><sapattahnd:Enabled xmlns:sapattahnd="http://www.sap.com/710/features/attachment/">false</sapattahnd:Enabled><saptrnbnd:OptimizedXMLTransfer uri="http://xml.sap.com/2006/11/esi/esp/binxml" xmlns:saptrnbnd="http://www.sap.com/webas/710/soap/features/transportbinding/" wsp:Optional="true"/><wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsp:Optional="true"/><wsp:All xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sp:HttpBasicAuthentication/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All><wsp:All><sapattahnd:Enabled xmlns:sapattahnd="http://www.sap.com/710/features/attachment/">false</sapattahnd:Enabled><saptrnbnd:OptimizedXMLTransfer uri="http://xml.sap.com/2006/11/esi/esp/binxml" xmlns:saptrnbnd="http://www.sap.com/webas/710/soap/features/transportbinding/" wsp:Optional="true"/><wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsp:Optional="true"/><wsp:All xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sapsp:HTTPSSO2 SAPClient="" SID=""/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All></wsp:ExactlyOne></wsp:Policy><wsp:Policy wsu:Id=""><wsp:ExactlyOne><wsp:All><sapsession:Session xmlns:sapsession="http://www.sap.com/webas/630/soap/features/session/"><sapsession:enableSession>false</sapsession:enableSession></sapsession:Session><sapcentraladmin:CentralAdministration xmlns:sapcentraladmin="http://www.sap.com/webas/700/soap/features/CentralAdministration/" wsp:Optional="true"><sapcentraladmin:BusinessApplicationID></sapcentraladmin:BusinessApplicationID></sapcentraladmin:CentralAdministration></wsp:All></wsp:ExactlyOne></wsp:Policy><wsp:Policy wsu:Id=""><wsp:ExactlyOne><wsp:All><saptrhnw05:required xmlns:saptrhnw05="http://www.sap.com/NW05/soap/features/transaction/">no</saptrhnw05:required><sapcomhnd:enableCommit xmlns:sapcomhnd="/">false</sapcomhnd:enableCommit><sapblock:enableBlocking xmlns:sapblock="http://www.sap.com/NW05/soap/features/blocking/">true</sapblock:enableBlocking><saprmnw05:enableWSRM xmlns:saprmnw05="">false</saprmnw05:enableWSRM></wsp:All></wsp:ExactlyOne></wsp:Policy><wsp:Policy wsu:Id=""><wsp:ExactlyOne><wsp:All><saptrhnw05:required xmlns:saptrhnw05="http://www.sap.com/NW05/soap/features/transaction/">no</saptrhnw05:required><sapcomhnd:enableCommit xmlns:sapcomhnd="http://www.sap.com/NW05/soap/features/commit/">false</sapcomhnd:enableCommit><sapblock:enableBlocking xmlns:sapblock="http://www.sap.com/NW05/soap/features/blocking/">true</sapblock:enableBlocking><saprmnw05:enableWSRM xmlns:saprmnw05="http://www.sap.com/NW05/soap/features/wsrm/">false</saprmnw05:enableWSRM></wsp:All></wsp:ExactlyOne></wsp:Policy><wsdl:types><xsd:schema attributeFormDefault="qualified" targetNamespace=""><xsd:simpleType name="char1"><xsd:restriction base="xsd:string"><xsd:maxLength value="1"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char10"><xsd:restriction base="xsd:string"><xsd:maxLength value="10"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char1024"><xsd:restriction base="xsd:string"><xsd:maxLength value="1024"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char20"><xsd:restriction base="xsd:string"><xsd:maxLength value="20"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char2014"><xsd:restriction base="xsd:string"><xsd:maxLength value="2014"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char220"><xsd:restriction base="xsd:string"><xsd:maxLength value="220"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char25"><xsd:restriction base="xsd:string"><xsd:maxLength value="25"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char255"><xsd:restriction base="xsd:string"><xsd:maxLength value="255"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char3"><xsd:restriction base="xsd:string"><xsd:maxLength value="3"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char5"><xsd:restriction base="xsd:string"><xsd:maxLength value="5"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char50"><xsd:restriction base="xsd:string"><xsd:maxLength value="50"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="clnt3"><xsd:restriction base="xsd:string"><xsd:maxLength value="3"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="date10"><xsd:restriction base="xsd:string"><xsd:maxLength value="10"/><xsd:pattern value="\d\d\d\d-\d\d-\d\d"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="decimal13.0"><xsd:restriction base="xsd:decimal"><xsd:totalDigits value="13"/><xsd:fractionDigits value="0"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="numeric10"><xsd:restriction base="xsd:string"><xsd:maxLength value="10"/><xsd:pattern value="\d*"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="numeric4"><xsd:restriction base="xsd:string"><xsd:maxLength value="4"/><xsd:pattern value="\d*"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="numeric6"><xsd:restriction base="xsd:string"><xsd:maxLength value="6"/><xsd:pattern value="\d*"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="quantum13.3"><xsd:restriction base="xsd:decimal"><xsd:totalDigits value="13"/><xsd:fractionDigits value="3"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="unit3"><xsd:restriction base="xsd:string"><xsd:maxLength value="3"/></xsd:restriction></xsd:simpleType></xsd:schema><xsd:schema attributeFormDefault="qualified" targetNamespace="" xmlns:n0=""><xsd:import namespace="urn:sap-com:document:sap:rfc:functions"/><xsd:complexType name=""><xsd:sequence><xsd:element name="" type="n0:clnt3"/><xsd:element name="" type="n0:char3"/><xsd:element name="" type="n0:char10"/><xsd:element name="" type="n0:char1024"/><xsd:element name="" type="n0:char25"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/></xsd:sequence></xsd:complexType><xsd:complexType name=""><xsd:sequence><xsd:element name="" type="n0:numeric4"/><xsd:element name="Lqnum" type="n0:numeric10"/><xsd:element name="" type="n0:quantum13.3"/><xsd:element name="" type="n0:unit3"/><xsd:element name="" type="n0:char1024"/><xsd:element name="" type="n0:char25"/><xsd:element name="" type="n0:date10"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:char255"/><xsd:element name="OptString3" type="n0:char255"/><xsd:element name="OptString4" type="n0:char255"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/></xsd:sequence></xsd:complexType><xsd:complexType name=""><xsd:sequence><xsd:element name="Type" type="n0:char1"/><xsd:element name="" type="n0:char5"/><xsd:element name="" type="n0:char220"/><xsd:element name="" type="n0:char20"/><xsd:element name="" type="n0:numeric6"/><xsd:element name="" type="n0:char50"/><xsd:element name="" type="n0:char50"/><xsd:element name="" type="n0:char50"/><xsd:element name="" type="n0:char50"/></xsd:sequence></xsd:complexType><xsd:complexType name=""><xsd:sequence><xsd:element name="" type="n0:clnt3"/><xsd:element name="" type="n0:char3"/><xsd:element name="" type="n0:numeric10"/><xsd:element name="" type="n0:char2014"/><xsd:element name="" type="n0:char25"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/></xsd:sequence></xsd:complexType><xsd:complexType name=""><xsd:sequence><xsd:element name="" type="n0:numeric4"/><xsd:element name="" type="n0:quantum13.3"/><xsd:element name="" type="n0:unit3"/><xsd:element name="" type="n0:char3"/><xsd:element name="" type="n0:char10"/><xsd:element name="" type="n0:char1024"/><xsd:element name="" type="n0:char25"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/></xsd:sequence></xsd:complexType><xsd:complexType name=""><xsd:sequence><xsd:element name="item" type="tns:" minOccurs="0" maxOccurs="unbounded"/></xsd:sequence></xsd:complexType><xsd:complexType name=""><xsd:sequence><xsd:element name="item" type="tns:" minOccurs="0" maxOccurs="unbounded"/></xsd:sequence></xsd:complexType><xsd:element name=""><xsd:complexType><xsd:sequence><xsd:element name="" type="tns:"/><xsd:element name="" type="tns:"/></xsd:sequence></xsd:complexType></xsd:element><xsd:element name=""><xsd:complexType><xsd:sequence><xsd:element name="" type="tns:"/></xsd:sequence></xsd:complexType></xsd:element><xsd:element name=""><xsd:complexType><xsd:sequence><xsd:element name="" type="tns:"/><xsd:element name="" type="tns:"/></xsd:sequence></xsd:complexType></xsd:element><xsd:element name=""><xsd:complexType><xsd:sequence><xsd:element name="" type="tns:"/></xsd:sequence></xsd:complexType></xsd:element></xsd:schema></wsdl:types><wsdl:message name=""><wsdl:part name="" element="tns:"/></wsdl:message><wsdl:message name=""><wsdl:part name="" element="tns:"/></wsdl:message><wsdl:message name=""><wsdl:part name="" element="tns:"/></wsdl:message><wsdl:message name=""><wsdl:part name="" element="tns:"/></wsdl:message><wsdl:portType name=""><wsp:Policy><wsp:PolicyReference URI="#"/></wsp:Policy><wsdl:operation name=""><wsp:Policy><wsp:PolicyReference URI="#"/></wsp:Policy><wsdl:input message="tns:"/><wsdl:output message="tns:"/></wsdl:operation><wsdl:operation name=""><wsp:Policy><wsp:PolicyReference URI="#"/></wsp:Policy><wsdl:input message="tns:"/><wsdl:output message="tns:"/></wsdl:operation></wsdl:portType><wsdl:binding name="" type="tns:"><wsp:Policy><wsp:PolicyReference URI="#"/></wsp:Policy><soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/><wsdl:operation name=""><soap:operation soapAction="" style="document"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdl:output><soap:body use="literal"/></wsdl:output></wsdl:operation><wsdl:operation name=""><soap:operation soapAction="" style="document"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdl:output><soap:body use="literal"/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding name="" type="tns:"><wsp:Policy><wsp:PolicyReference URI="#"/></wsp:Policy><wsoap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/><wsdl:operation name=""><wsoap12:operation soapAction="u" style="document"/><wsdl:input><wsoap12:body use="literal"/></wsdl:input><wsdl:output><wsoap12:body use="literal"/></wsdl:output></wsdl:operation><wsdl:operation name=""><wsoap12:operation soapAction="" style="document"/><wsdl:input><wsoap12:body use="literal"/></wsdl:input><wsdl:output><wsoap12:body use="literal"/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service name=""><wsdl:port name="" binding="tns:"><soap:address location=""/></wsdl:port><wsdl:port name="" binding="tns:"><wsoap12:address location=""/></wsdl:port></wsdl:service></wsdl:definitions>
我的 Web 服务客户端代码在下面,我设置了我的身份验证器(此处),然后我继续
private static ReturedValue myFunction(Position inPosizioni, Header inTestata) {
MYSERVICE_Service service = new MYSERVICE_Service();
MYSERVICE port = service.getPORT();
Authenticator.setDefault(new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("MY_SECRET_USERNAME", "MY_SECRET_PASSWORD".toCharArray());
}
}
);
return port.return(inPosizioni, inTestata);
}
几点:
1)这个相同的代码在早些时候运行。
2) 我检查了 How to secure a web service with ssl 但从服务器端没有 SSL 端点并且没有 SSL 端口(所以我使用默认的 http 端口 8080)
3) 我的项目之外的相同代码(我用 main 方法编写了一个简单的测试器)工作正常所以我猜我的 web 应用程序中有一些东西(可能是由于以前的客户端)即使我删除了以前的代码并清理了项目仍然存在
最后我解决了:问题出在 WSDL 中的策略,wsdl 是由 SAP 生成的。我将 url 从
更改为 wsdl
http://address:8080/some_path/ws_policy/document?sap-client=001
到
http://address:8080/some_path/standard/document?sap-client=001
(将 "ws_policy" 更改为 "standard"
见:https://blogs.sap.com/2010/03/19/wsdl-wspolicy-what-is-it-und-how-can-i-get-rid-of-it-in-pi/
我有一个 Web 服务客户端(在部署在 tomcat 6 上的 Java 应用程序项目中)。直到几天前端点已更改时一切正常。
Endpoints 需要访问 WSDL 的基本身份验证和执行服务的基本身份验证。
我正在使用 netbeans,我创建了一个 Web 服务客户端,我在其中指定了 wsdl url,netbeans 需要 username/password 来生成代码。执行代码时,这是错误
19-gen-2017 20.24.25 com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient createMessage
GRAVE: WSS1601: Security Requirements not met - Transport binding configured in policy but incoming message was not SSL enabled
19-gen-2017 20.24.25 com.sun.xml.wss.jaxws.impl.SecurityClientTube processClientResponsePacket
GRAVE: WSSTUBE0025: Error in Verifying Security in the Inbound Message.
com.sun.xml.wss.XWSSecurityException: WSS1601: Security Requirements not met - Transport binding configured in policy but incoming message was not SSL enabled
20:24:25:360 - ERROR - - Stacktrace:
javax.xml.ws.WebServiceException: WSSTUBE0025: Error in Verifying Security in the Inbound Message.
at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.createMessage(SecurityRecipient.java:973)
at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processClientResponsePacket(SecurityClientTube.java:417)
at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.validateMessage(SecurityRecipient.java:230)
at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processResponse(SecurityClientTube.java:345)
at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.verifyInboundMessage(SecurityTubeBase.java:462)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:639)
at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processClientResponsePacket(SecurityClientTube.java:412)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588)
at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processResponse(SecurityClientTube.java:345)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:639)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:470)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588)
at com.sun.xml.ws.client.Stub.process(Stub.java:319)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:470)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:157)
at com.sun.xml.ws.client.Stub.process(Stub.java:319)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:109)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:157)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:109)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:140)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:140)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.xml.ws.soap.SOAPFaultException: WSS1601: Security Requirements not met - Transport binding configured in policy but incoming message was not SSL enabled
at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.getSOAPFaultException(SecurityTubeBase.java:674)
at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.getSOAPFaultException(SecurityTubeBase.java:692)
... 33 more
Caused by: com.sun.xml.wss.impl.WssSoapFaultException: WSS1601: Security Requirements not met - Transport binding configured in policy but incoming message was not SSL enabled
at com.sun.xml.wss.impl.SecurableSoapMessage.newSOAPFaultException(SecurableSoapMessage.java:336)
at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.getSOAPFaultException(SecurityTubeBase.java:688)
... 33 more
Caused by: com.sun.xml.wss.XWSSecurityException: WSS1601: Security Requirements not met - Transport binding configured in policy but incoming message was not SSL enabled
at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.createMessage(SecurityRecipient.java:973)
at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.validateMessage(SecurityRecipient.java:230)
at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.verifyInboundMessage(SecurityTubeBase.java:462)
at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processClientResponsePacket(SecurityClientTube.java:412
这是 WSDL 文件(出于隐私原因删除了一些名称)
<?xml version="1.0" encoding="utf-8"?><wsdl:definitions targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsoap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:n1="urn:sap-com:document:sap:rfc:functions"><wsdl:documentation><sidl:sidl xmlns:sidl="http://www.sap.com/2007/03/sidl"/></wsdl:documentation><wsp:UsingPolicy wsdl:required="true"/><wsp:Policy wsu:Id=""><wsp:ExactlyOne><wsp:All><sapattahnd:Enabled xmlns:sapattahnd="http://www.sap.com/710/features/attachment/">false</sapattahnd:Enabled><saptrnbnd:OptimizedMimeSerialization xmlns:saptrnbnd="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization" wsp:Optional="true"/><wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsp:Optional="true"/><wsp:All xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sp:HttpBasicAuthentication/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All><wsp:All><sapattahnd:Enabled xmlns:sapattahnd="http://www.sap.com/710/features/attachment/">false</sapattahnd:Enabled><saptrnbnd:OptimizedMimeSerialization xmlns:saptrnbnd="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization" wsp:Optional="true"/><wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsp:Optional="true"/><wsp:All xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sapsp:HTTPSSO2 SAPClient="" SID=""/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All><wsp:All><sapattahnd:Enabled xmlns:sapattahnd="http://www.sap.com/710/features/attachment/">false</sapattahnd:Enabled><saptrnbnd:OptimizedXMLTransfer uri="" xmlns:saptrnbnd="http://www.sap.com/webas/710/soap/features/transportbinding/" wsp:Optional="true"/><wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsp:Optional="true"/><wsp:All xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sp:HttpBasicAuthentication/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All><wsp:All><sapattahnd:Enabled xmlns:sapattahnd="http://www.sap.com/710/features/attachment/">false</sapattahnd:Enabled><saptrnbnd:OptimizedXMLTransfer uri="http://xml.sap.com/2006/11/esi/esp/binxml" xmlns:saptrnbnd="http://www.sap.com/webas/710/soap/features/transportbinding/" wsp:Optional="true"/><wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsp:Optional="true"/><wsp:All xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sapsp:HTTPSSO2 SAPClient="" SID=""/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All></wsp:ExactlyOne></wsp:Policy><wsp:Policy wsu:Id=""><wsp:ExactlyOne><wsp:All><sapattahnd:Enabled xmlns:sapattahnd="http://www.sap.com/710/features/attachment/">false</sapattahnd:Enabled><saptrnbnd:OptimizedMimeSerialization xmlns:saptrnbnd="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization" wsp:Optional="true"/><wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsp:Optional="true"/><wsp:All xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sp:HttpBasicAuthentication/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All><wsp:All><sapattahnd:Enabled xmlns:sapattahnd="http://www.sap.com/710/features/attachment/">false</sapattahnd:Enabled><saptrnbnd:OptimizedMimeSerialization xmlns:saptrnbnd="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization" wsp:Optional="true"/><wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsp:Optional="true"/><wsp:All xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sapsp:HTTPSSO2 SAPClient="" SID=""/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All><wsp:All><sapattahnd:Enabled xmlns:sapattahnd="http://www.sap.com/710/features/attachment/">false</sapattahnd:Enabled><saptrnbnd:OptimizedXMLTransfer uri="http://xml.sap.com/2006/11/esi/esp/binxml" xmlns:saptrnbnd="http://www.sap.com/webas/710/soap/features/transportbinding/" wsp:Optional="true"/><wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsp:Optional="true"/><wsp:All xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sp:HttpBasicAuthentication/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All><wsp:All><sapattahnd:Enabled xmlns:sapattahnd="http://www.sap.com/710/features/attachment/">false</sapattahnd:Enabled><saptrnbnd:OptimizedXMLTransfer uri="http://xml.sap.com/2006/11/esi/esp/binxml" xmlns:saptrnbnd="http://www.sap.com/webas/710/soap/features/transportbinding/" wsp:Optional="true"/><wsaw:UsingAddressing xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" wsp:Optional="true"/><wsp:All xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><sp:TransportBinding xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"><wsp:Policy><sp:TransportToken><wsp:Policy><sp:HttpsToken><wsp:Policy><sapsp:HTTPSSO2 SAPClient="" SID=""/></wsp:Policy></sp:HttpsToken></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic128Rsa15/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding></wsp:All></wsp:All></wsp:ExactlyOne></wsp:Policy><wsp:Policy wsu:Id=""><wsp:ExactlyOne><wsp:All><sapsession:Session xmlns:sapsession="http://www.sap.com/webas/630/soap/features/session/"><sapsession:enableSession>false</sapsession:enableSession></sapsession:Session><sapcentraladmin:CentralAdministration xmlns:sapcentraladmin="http://www.sap.com/webas/700/soap/features/CentralAdministration/" wsp:Optional="true"><sapcentraladmin:BusinessApplicationID></sapcentraladmin:BusinessApplicationID></sapcentraladmin:CentralAdministration></wsp:All></wsp:ExactlyOne></wsp:Policy><wsp:Policy wsu:Id=""><wsp:ExactlyOne><wsp:All><saptrhnw05:required xmlns:saptrhnw05="http://www.sap.com/NW05/soap/features/transaction/">no</saptrhnw05:required><sapcomhnd:enableCommit xmlns:sapcomhnd="/">false</sapcomhnd:enableCommit><sapblock:enableBlocking xmlns:sapblock="http://www.sap.com/NW05/soap/features/blocking/">true</sapblock:enableBlocking><saprmnw05:enableWSRM xmlns:saprmnw05="">false</saprmnw05:enableWSRM></wsp:All></wsp:ExactlyOne></wsp:Policy><wsp:Policy wsu:Id=""><wsp:ExactlyOne><wsp:All><saptrhnw05:required xmlns:saptrhnw05="http://www.sap.com/NW05/soap/features/transaction/">no</saptrhnw05:required><sapcomhnd:enableCommit xmlns:sapcomhnd="http://www.sap.com/NW05/soap/features/commit/">false</sapcomhnd:enableCommit><sapblock:enableBlocking xmlns:sapblock="http://www.sap.com/NW05/soap/features/blocking/">true</sapblock:enableBlocking><saprmnw05:enableWSRM xmlns:saprmnw05="http://www.sap.com/NW05/soap/features/wsrm/">false</saprmnw05:enableWSRM></wsp:All></wsp:ExactlyOne></wsp:Policy><wsdl:types><xsd:schema attributeFormDefault="qualified" targetNamespace=""><xsd:simpleType name="char1"><xsd:restriction base="xsd:string"><xsd:maxLength value="1"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char10"><xsd:restriction base="xsd:string"><xsd:maxLength value="10"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char1024"><xsd:restriction base="xsd:string"><xsd:maxLength value="1024"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char20"><xsd:restriction base="xsd:string"><xsd:maxLength value="20"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char2014"><xsd:restriction base="xsd:string"><xsd:maxLength value="2014"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char220"><xsd:restriction base="xsd:string"><xsd:maxLength value="220"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char25"><xsd:restriction base="xsd:string"><xsd:maxLength value="25"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char255"><xsd:restriction base="xsd:string"><xsd:maxLength value="255"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char3"><xsd:restriction base="xsd:string"><xsd:maxLength value="3"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char5"><xsd:restriction base="xsd:string"><xsd:maxLength value="5"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="char50"><xsd:restriction base="xsd:string"><xsd:maxLength value="50"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="clnt3"><xsd:restriction base="xsd:string"><xsd:maxLength value="3"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="date10"><xsd:restriction base="xsd:string"><xsd:maxLength value="10"/><xsd:pattern value="\d\d\d\d-\d\d-\d\d"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="decimal13.0"><xsd:restriction base="xsd:decimal"><xsd:totalDigits value="13"/><xsd:fractionDigits value="0"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="numeric10"><xsd:restriction base="xsd:string"><xsd:maxLength value="10"/><xsd:pattern value="\d*"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="numeric4"><xsd:restriction base="xsd:string"><xsd:maxLength value="4"/><xsd:pattern value="\d*"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="numeric6"><xsd:restriction base="xsd:string"><xsd:maxLength value="6"/><xsd:pattern value="\d*"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="quantum13.3"><xsd:restriction base="xsd:decimal"><xsd:totalDigits value="13"/><xsd:fractionDigits value="3"/></xsd:restriction></xsd:simpleType><xsd:simpleType name="unit3"><xsd:restriction base="xsd:string"><xsd:maxLength value="3"/></xsd:restriction></xsd:simpleType></xsd:schema><xsd:schema attributeFormDefault="qualified" targetNamespace="" xmlns:n0=""><xsd:import namespace="urn:sap-com:document:sap:rfc:functions"/><xsd:complexType name=""><xsd:sequence><xsd:element name="" type="n0:clnt3"/><xsd:element name="" type="n0:char3"/><xsd:element name="" type="n0:char10"/><xsd:element name="" type="n0:char1024"/><xsd:element name="" type="n0:char25"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/></xsd:sequence></xsd:complexType><xsd:complexType name=""><xsd:sequence><xsd:element name="" type="n0:numeric4"/><xsd:element name="Lqnum" type="n0:numeric10"/><xsd:element name="" type="n0:quantum13.3"/><xsd:element name="" type="n0:unit3"/><xsd:element name="" type="n0:char1024"/><xsd:element name="" type="n0:char25"/><xsd:element name="" type="n0:date10"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:char255"/><xsd:element name="OptString3" type="n0:char255"/><xsd:element name="OptString4" type="n0:char255"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/></xsd:sequence></xsd:complexType><xsd:complexType name=""><xsd:sequence><xsd:element name="Type" type="n0:char1"/><xsd:element name="" type="n0:char5"/><xsd:element name="" type="n0:char220"/><xsd:element name="" type="n0:char20"/><xsd:element name="" type="n0:numeric6"/><xsd:element name="" type="n0:char50"/><xsd:element name="" type="n0:char50"/><xsd:element name="" type="n0:char50"/><xsd:element name="" type="n0:char50"/></xsd:sequence></xsd:complexType><xsd:complexType name=""><xsd:sequence><xsd:element name="" type="n0:clnt3"/><xsd:element name="" type="n0:char3"/><xsd:element name="" type="n0:numeric10"/><xsd:element name="" type="n0:char2014"/><xsd:element name="" type="n0:char25"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/></xsd:sequence></xsd:complexType><xsd:complexType name=""><xsd:sequence><xsd:element name="" type="n0:numeric4"/><xsd:element name="" type="n0:quantum13.3"/><xsd:element name="" type="n0:unit3"/><xsd:element name="" type="n0:char3"/><xsd:element name="" type="n0:char10"/><xsd:element name="" type="n0:char1024"/><xsd:element name="" type="n0:char25"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:char255"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/><xsd:element name="" type="n0:decimal13.0"/></xsd:sequence></xsd:complexType><xsd:complexType name=""><xsd:sequence><xsd:element name="item" type="tns:" minOccurs="0" maxOccurs="unbounded"/></xsd:sequence></xsd:complexType><xsd:complexType name=""><xsd:sequence><xsd:element name="item" type="tns:" minOccurs="0" maxOccurs="unbounded"/></xsd:sequence></xsd:complexType><xsd:element name=""><xsd:complexType><xsd:sequence><xsd:element name="" type="tns:"/><xsd:element name="" type="tns:"/></xsd:sequence></xsd:complexType></xsd:element><xsd:element name=""><xsd:complexType><xsd:sequence><xsd:element name="" type="tns:"/></xsd:sequence></xsd:complexType></xsd:element><xsd:element name=""><xsd:complexType><xsd:sequence><xsd:element name="" type="tns:"/><xsd:element name="" type="tns:"/></xsd:sequence></xsd:complexType></xsd:element><xsd:element name=""><xsd:complexType><xsd:sequence><xsd:element name="" type="tns:"/></xsd:sequence></xsd:complexType></xsd:element></xsd:schema></wsdl:types><wsdl:message name=""><wsdl:part name="" element="tns:"/></wsdl:message><wsdl:message name=""><wsdl:part name="" element="tns:"/></wsdl:message><wsdl:message name=""><wsdl:part name="" element="tns:"/></wsdl:message><wsdl:message name=""><wsdl:part name="" element="tns:"/></wsdl:message><wsdl:portType name=""><wsp:Policy><wsp:PolicyReference URI="#"/></wsp:Policy><wsdl:operation name=""><wsp:Policy><wsp:PolicyReference URI="#"/></wsp:Policy><wsdl:input message="tns:"/><wsdl:output message="tns:"/></wsdl:operation><wsdl:operation name=""><wsp:Policy><wsp:PolicyReference URI="#"/></wsp:Policy><wsdl:input message="tns:"/><wsdl:output message="tns:"/></wsdl:operation></wsdl:portType><wsdl:binding name="" type="tns:"><wsp:Policy><wsp:PolicyReference URI="#"/></wsp:Policy><soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/><wsdl:operation name=""><soap:operation soapAction="" style="document"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdl:output><soap:body use="literal"/></wsdl:output></wsdl:operation><wsdl:operation name=""><soap:operation soapAction="" style="document"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdl:output><soap:body use="literal"/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding name="" type="tns:"><wsp:Policy><wsp:PolicyReference URI="#"/></wsp:Policy><wsoap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/><wsdl:operation name=""><wsoap12:operation soapAction="u" style="document"/><wsdl:input><wsoap12:body use="literal"/></wsdl:input><wsdl:output><wsoap12:body use="literal"/></wsdl:output></wsdl:operation><wsdl:operation name=""><wsoap12:operation soapAction="" style="document"/><wsdl:input><wsoap12:body use="literal"/></wsdl:input><wsdl:output><wsoap12:body use="literal"/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service name=""><wsdl:port name="" binding="tns:"><soap:address location=""/></wsdl:port><wsdl:port name="" binding="tns:"><wsoap12:address location=""/></wsdl:port></wsdl:service></wsdl:definitions>
我的 Web 服务客户端代码在下面,我设置了我的身份验证器(此处),然后我继续
private static ReturedValue myFunction(Position inPosizioni, Header inTestata) {
MYSERVICE_Service service = new MYSERVICE_Service();
MYSERVICE port = service.getPORT();
Authenticator.setDefault(new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("MY_SECRET_USERNAME", "MY_SECRET_PASSWORD".toCharArray());
}
}
);
return port.return(inPosizioni, inTestata);
}
几点: 1)这个相同的代码在早些时候运行。 2) 我检查了 How to secure a web service with ssl 但从服务器端没有 SSL 端点并且没有 SSL 端口(所以我使用默认的 http 端口 8080) 3) 我的项目之外的相同代码(我用 main 方法编写了一个简单的测试器)工作正常所以我猜我的 web 应用程序中有一些东西(可能是由于以前的客户端)即使我删除了以前的代码并清理了项目仍然存在
最后我解决了:问题出在 WSDL 中的策略,wsdl 是由 SAP 生成的。我将 url 从
更改为 wsdlhttp://address:8080/some_path/ws_policy/document?sap-client=001 到 http://address:8080/some_path/standard/document?sap-client=001 (将 "ws_policy" 更改为 "standard" 见:https://blogs.sap.com/2010/03/19/wsdl-wspolicy-what-is-it-und-how-can-i-get-rid-of-it-in-pi/