I'm creating a web service client using Apache CXF 2.5. , JDK 7 and Eclipse Helios EE. I get the folllowing error after i execute the net service client in eclipse.
Exception in thread "primary" javax.xml.ws.cleaning soap.SOAPFaultException: Mention of the policy #AddressingPolicy couldn't be resolved..
I've adopted the below steps to date to deploy the customer.
Produced a java project in eclipse helios EE and added CXF runtime towards the project.
Using Apache CXF 2.5. WSDL2Java produced the java courses of instruction for the customer ( incorporated -exsh true choice to process the headers). The classes were produced within the eclipse src dir.
Implemented the primary method within the client class to invoke the net service.
After I execute the customer I recieve the above mentioned exception.
I've checked the WSDL and contains one Policy Reference element with xml id = #AddressingPolicy and the other Policy Reference element with xml id = #TlsPolicy inside the binding element. The particular guidelines are succumbed the WSDL in the finish from the WSDl using wsp:Policy elements.
I am unable to customize the WSDL as it's been already used like a exterior service and presented to me to build up the customer.
Has anybody faced similar problem with Apache CXF 2.5. before. Also Personally i think it may be an problem using the version of CXF I'm using. Does Apache CXF 2.5. support local policy references inside the WSDL.
Thank you for reactions.
I simply had exactly the same problem. The fix I discovered ended up being to customize the WSDL and employ an wsu:Id reference rather than xml:id.
<wsp:Policy wsu:Id="AddressingPolicy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <...> </wsp:Policy>
I understand you mentioned that you simply can't alter the WSDL, however i believe this isn't true. The alteration I've pointed out won't alter the items in the Cleaning soap demands/reactions around the wire which means you should still have the ability to interoperate using the existing web service.