I think if you add -validate=none to the wsdl2java command, it would bypass that check.
: colon is not a valid char in the targetNamespace cxf-codegen-plugin wsdl2java
-
01-06-2022 - |
Question
I want to use cxf and i am trying to generate a client stub from a provided WSDL by maven with cxf-codegen-plugin wsdl2java
Problem is the targetNamespace is named:
http://ip:port/ws/EndpointName.inbound.ws:companyName
and maven generate-sources phase fails with:
[ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-plugin:2.7.5:wsdl2java (generate-jaxb) on project: Execution generate-jaxb of goal org.apache.cxf:cxf-codegen-plugin:2.7.5:wsdl2java failed: org.apache.cxf.tools.common.ToolException: : is not a valid char in the targetNamespace -> [Help 1]
I believe the endpoint is developed using WebMethods. The company hosting this WS endpoint is telling me they have no control over the targetNamespace.
I tried remplacing
:companyName
by
/companyName
client stub generation goes fine but I get an error when I try to contact their server:
Caused by: javax.ejb.EJBException: javax.xml.ws.WebServiceException: Could not find service named {http://ip:port/ws/EndpointName.inbound.ws/companyName}WebServiceName in wsdl http://ip:port/ws/EndpointName.inbound.ws:companyName?WSDL
Any idea? Should i switch to axis2 to be compatible with WebMethods?
Thanks a lot
Solution 2
OTHER TIPS
": is not a valid char in the targetNamespace"
resolved by CXF-6527.
You should update your Apache CXF version to a newer version. Issue which has resolved that problem has Fix Version/s of: 3.1.3, 2.7.18, 3.0.7