1
votes

Im using CXF to generate client-side artifacts and to generate my wsdl using the java2ws plugin.

In the configuration of CXF for generation of the WSDL on tomcat where you need to define the jaxws:endpoint - I am having an issue with CXF configuration setting for the jaxws:endpoint address property. The finally generated wsdl has a syntax issue

CXF.xml (not using spring jars in my MAVEN POM) ->

<import resource="classpath:META-INF/cxf/cxf.xml" />
   <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
   <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
 <jaxws:endpoint id="JMSMetricsServiceEndpoint" 
      implementor="com.putnam.jms.monitor.websvcs.JMSMetricsService"
      address="/">
 </jaxws:endpoint>

The jaxws:address element specifies the address of the endpoint as defined in the WSDL file that defines service that is being deployed. This needs the absolute URL specification for the correct soap:address to be written into the generated WSDL. Currently this is set to "/" - which works for me - because the address is ready directly from the wsdl except it appends a trailing slash at the end of the soap:address -> when it generates the wsdl as the end product as such

 <soap:address = ' ...... /'> 

My goal is to get this to deploy in such a manner that I do not have an excessive / appended.

I have tried removing the address field altogether but that hasnt worked. I have also tried hardcoding the address i.e. using the absolute URI

 <jaxws:endpoint
 id="JMSMetricsServiceEndpoint" 
       implementor="com.putnam.jms.monitor.websvcs.JMSMetricsService"
       address="${HOST_NAME}">

where $HOST_NAME = full http path where the wsdl resides...

example $HOST_NAME = "http://localhost...."

But that doesnt seem to work either.

That change causes malformed WSDL at the present moment even when it is pointing in the right direction.

1

1 Answers

1
votes

Adi, I see a contradiction in your description - you are saying that you are generating client side artifacts but your configuration is for a service endpoint. For a client the appropriate configuration is -

<jaxws:client...>

not

<jaxws:endpoint..>

Assuming you are writing a service not a client, address is relative, when you ask for a wsdl from the service, the url of the service is derived from request url and the relative URI from the address you specify, unless you want to specify an explicit wsdl(not a generated one) with wsdlLocation parameter of jaxws:service.