cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel FOUCHE (JIRA)" <>
Subject [jira] [Created] (CXF-5047) Wrong soap:address generated in WSDL
Date Wed, 29 May 2013 16:32:20 GMT
Emmanuel FOUCHE created CXF-5047:

             Summary: Wrong soap:address generated in WSDL 
                 Key: CXF-5047
             Project: CXF
          Issue Type: Bug
          Components: JAX-WS Runtime
    Affects Versions: 2.7.0
         Environment: WinXPsp3; Java-1.6.0_35; Tomcat-7.0.33
            Reporter: Emmanuel FOUCHE

I am currently tweaking the DoubleItService tutorial described by Glen Mazza on his Weblog

I created test clients using generated classes using wsdl2java. Everything works as intented.

Now I would like to expose the same service at two location. 
Intended use is to filter access by requiring authentication at container level on some url-pattern
like /underquota/doubleit, while /services/doubleit default remains accessible.

In WSDL, I added a second <wsdl:port> element 
<wsdl:service name="DoubleItService">
 <wsdl:port name="DoubleItPort" binding="tns:DoubleItBinding">
   <soap:address location="http://localhost:8080/fr.efe4it.sample.webmodule.doubleitwsunderquota/services/doubleit"/>
 <wsdl:port name="DoubleItPortUnderquota" binding="tns:DoubleItBinding">
         <soap:address location="http://localhost:8080/fr.efe4it.sample.webmodule.doubleitwsunderquota/underquota/doubleit"/>

In cxf-servlet.xml, I declared 2 endpoints
<jaxws:endpoint id="doubleit"
<jaxws:endpoint id="doubleitunderquota"


The wsdl2java-generated classe DoubleItService now has 2 methods to retrieve each portType

@WebEndpoint(name = "DoubleItPort")
public DoubleItPortType getDoubleItPort() {
 return super.getPort(DoubleItPort, DoubleItPortType.class);
@WebEndpoint(name = "DoubleItPortUnderquota")
public DoubleItPortType getDoubleItPortUnderquota() {
 return super.getPort(DoubleItPortUnderquota, DoubleItPortType.class);

I also have to implementors, attached to the corresponding portName. Below is the one attached
to the portName I added to the WSDL.
@WebService(targetNamespace = "", //
portName = "DoubleItPortUnderquota", //
serviceName = "DoubleItService", //
endpointInterface = "org.example.contract.doubleit.DoubleItPortType")
@Features(features = "org.apache.cxf.feature.LoggingFeature")
public class DoubleItUnderQuotaPortTypeImpl implements DoubleItPortType {

When deploying the WAR under Tomcat, the call to http://localhost:8080/myapp/services/ display
the 2 deployed services with correct URL.

|DoubleItPortType|DoubleIt|Endpoint address: http://localhost:8080/fr.efe4it.sample.webmodule.doubleitwsunderquota/underquota/doubleit
WSDL : {}DoubleItService
Target namespace:|
|DoubleItPortType|DoubleIt|Endpoint address: http://localhost:8080/fr.efe4it.sample.webmodule.doubleitwsunderquota/services/doubleit
WSDL : {}DoubleItService
Target namespace:|

Using SoapUI, I can succesfully run test queries against the 2 services.

However, when I request the WSDL in the browser, only one publishedEndpointUrl corresponds
to what I setup in cxf-servlet.xml.

{code:xml title=published WSDL}
<wsdl:service name="DoubleItService">
<wsdl:port binding="tns:DoubleItBinding" name="DoubleItPortUnderquota">
<soap:address location="/underquota/doubleit"/>
<wsdl:port binding="tns:DoubleItBinding" name="DoubleItPort">
<soap:address location="http://localhost:8080/fr.efe4it.sample.webmodule.doubleitwsunderquota/services/doubleit"/>

A the SOAP address, here /underquota/doubleit, retrieved from published WSDL is the URL used
by my java test code to invoke service operations, I get the following error.

Caused by: URI is not absolute
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(
	at $Proxy27.doubleIt(Unknown Source)

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message