Java WsDeploymentException:无法从URI'#UsernameToken';
我已经开发了一个webservice客户端并部署在WebLogic11g上。该程序用于向第三方发送soap消息。当它由JDeveloper运行时,我可以从服务器端获得端口和响应。然而,当URI'#UsernameToken'在weblogic服务器上运行时,我得到了“无法从URI中检索策略” 这是我的程序代码Java WsDeploymentException:无法从URI'#UsernameToken';,java,web-services,wsdl,weblogic,jdeveloper,Java,Web Services,Wsdl,Weblogic,Jdeveloper,我已经开发了一个webservice客户端并部署在WebLogic11g上。该程序用于向第三方发送soap消息。当它由JDeveloper运行时,我可以从服务器端获得端口和响应。然而,当URI'#UsernameToken'在weblogic服务器上运行时,我得到了“无法从URI中检索策略” 这是我的程序代码 URL url = new URL("https://example.org:xxx/XXXInterface/XXXInterfaceWebS?wsdl"); XX
URL url = new URL("https://example.org:xxx/XXXInterface/XXXInterfaceWebS?wsdl");
XXXInterfaceWebS ws = new XXXInterfaceWebS(url, new QName("http://example.org/", "XXXInterfaceWebS"));
SecurityPoliciesFeature securityFeatures = new SecurityPoliciesFeature(new String[] { "oracle/wss_username_token_client_policy" });
XXXInterfacePortType wsClient = ws.getXXXInterfacePortTypePort(securityFeatures);
...
WSDL由第三方维护,我无法控制其中的内容
<definitions
name="XXXWebS"
targetNamespace="http://example.org/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:wssutil="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:tns="http://example.org/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>
<wsp:UsingPolicy wssutil:Required="true"/>
<wsp:Policy wssutil:Id="UsernameToken">
<ns1:SupportingTokens xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200512">
<wsp:Policy>
<ns1:UsernameToken ns1:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200512/IncludeToken/AlwaysToRecipient">
<wsp:Policy>
<ns1:WssUsernameToken10/>
</wsp:Policy>
</ns1:UsernameToken>
</wsp:Policy>
</ns1:SupportingTokens>
</wsp:Policy>
...
<binding name="XXXInterfacePortTypePortBinding" type="tns:XXXInterfacePortType">
<wsp:PolicyReference URI="#UsernameToken"/>
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="process">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
...
请帮我解决这个问题。为什么会有错误?我的代码或weblogic服务器设置是否有任何问题?
如果需要更多信息来确定问题,请告诉我
javax.xml.ws.WebServiceException: weblogic.wsee.ws.init.WsDeploymentException: Unable to to retrieve policy from URI '#UsernameToken'[[
at weblogic.wsee.jaxws.framework.jaxrpc.TubelineDeploymentListener.createClient(TubelineDeploymentListener.java:59)
at weblogic.wsee.jaxws.WLSTubelineAssemblerFactory$TubelineAssemblerImpl.createClient(WLSTubelineAssemblerFactory.java:100)
at com.sun.xml.ws.client.WSServiceDelegate.createPipeline(WSServiceDelegate.java:471)
at com.sun.xml.ws.client.WSServiceDelegate.getStubHandler(WSServiceDelegate.java:697)
at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:675)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:362)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.internalGetPort(WLSProvider.java:978)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate$PortClientInstanceFactory.createClientInstance(WLSProvider.java:1083)
at weblogic.wsee.jaxws.spi.ClientInstancePool.takeSimpleClientInstance(ClientInstancePool.java:376)
at weblogic.wsee.jaxws.spi.ClientInstancePool.take(ClientInstancePool.java:232)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.getPort(WLSProvider.java:896)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:344)
at weblogic.wsee.jaxws.spi.WLSProvider$ServiceDelegate.getPort(WLSProvider.java:836)
at javax.xml.ws.Service.getPort(Service.java:133)
at XXXInterfaceWebS.getXXXInterfacePortTypePort(XXXInterfaceWebS.java:86)
at xxxInterfaceService.callxxxInterfaceWs(xxxInterfaceService.java:154)
...
Caused by: weblogic.wsee.ws.init.WsDeploymentException: Unable to to retrieve policy from URI '#UsernameToken'
at weblogic.wsee.security.wssp.deploy.WssDeploymentListener.process(WssDeploymentListener.java:74)
at weblogic.wsee.jaxws.framework.jaxrpc.TubelineDeploymentListener.createClient(TubelineDeploymentListener.java:56)
at weblogic.wsee.jaxws.WLSTubelineAssemblerFactory$TubelineAssemblerImpl.createClient(WLSTubelineAssemblerFactory.java:99)
at com.sun.xml.ws.client.WSServiceDelegate.createPipeline(WSServiceDelegate.java:471)
... 15 more
Caused by: Unable to to retrieve policy from URI '#UsernameToken'
at weblogic.wsee.policy.deployment.PolicyRef.getPolicy(PolicyRef.java:230)
at weblogic.wsee.policy.deployment.PolicyReferenceWsdlExtension.getEffectivePolicy(PolicyReferenceWsdlExtension.java:125)
at weblogic.wsee.policy.deployment.WsdlPolicySubject.getEffectivePolicyFromWsdlExtensible(WsdlPolicySubject.java:485)
at weblogic.wsee.policy.deployment.WsdlPolicySubject.getEndpointPolicySubject(WsdlPolicySubject.java:341)
at weblogic.wsee.policy.runtime.PolicyContext.getRequestEffectivePolicy(PolicyContext.java:107)
at weblogic.wsee.policy.runtime.PolicyContext.getRequestEffectivePolicy(PolicyContext.java:74)
at weblogic.wsee.security.policy.assertions.SecurityPolicyAssertionFactory.hasSecurityPolicy(SecurityPolicyAssertionFactory.java:105)
at weblogic.wsee.security.wssp.deploy.WssDeploymentListener.process(WssDeploymentListener.java:54)
... 18 more