3
端點端口我配置CXF用下面的例子簽約:叫什麼名字我在cxf.conf
<jaxws:client name="{http://cxf.apache.org}MyPortName" createdFromAPI="true">
<jaxws:properties>
<entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback" />
<entry key="ws-security.signature.properties" value="etc/client.properties" />
<entry key="ws-security.encryption.properties" value="etc/service.properties" />
<entry key="ws-security.encryption.username" value="servicekeyalias" />
</jaxws:properties>
</jaxws:client>
見:http://cxf.apache.org/docs/ws-securitypolicy.html
我需要設置了正確的名稱根據腳註:
For the jaxws:client's name attribute above, use the namespace of the WSDL along
with the name attribute of the desired wsdl:port element under the WSDL's service
section. (See here and here for an example.)
該示例不起作用。
所以我的問題是這個名字應該是什麼?我在哪裏可以在我的wsdl和/或生成的代碼中找到這個?
是否有方法來驗證cxf.xml文件是否已加載?
我這樣做,因爲我得到這個錯誤:
PolicyException: Security configuration could not be detected. Potential cause: Make sure jaxws:client element with name attribute value matching endpoint port is defined as well as a ws-security.signature.properties element within it.
,我在代碼中看到,這(從abstractBindingBuilder):
(String)message.getContextualProperty(userNameKey);
的結果給予空。
以及任何幫助將是偉大的!