You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Maxim Solodovnik <so...@gmail.com> on 2014/10/11 09:33:13 UTC

WSDL and methods mapping to the same URL

Hello All,

I'm trying to move from Axis2 to cxf 3.0.x and make this move invisible to
end-users
Previously I had
WSDL URL: services/UserService?wsdl
method URL: services/UserService/getSession
(I know the methods need to be renamed, but currently I don't want to break
any client API)

Is it possible to perform same URL mapping?
I'm using "java first" approach and would like to write as few XML as
possible

I was able to create wsdl URL as follows:

<jaxrs:server id="server" address="/">
<jaxrs:serviceBeans>
<ref bean="userWebService"/>
</jaxrs:serviceBeans>
</jaxrs:server>
<jaxws:endpoint id="userServiceWS" address="/UserService"
implementor="#userWebService"
endpointName="UserServiceEndpoint"
serviceName="UserService"
/>

I was able to call web methods using following URL:
/services/user/getSession
@WebService(name = "UserService")
@Features(features = "org.apache.cxf.feature.LoggingFeature")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@Path("/user")
public class UserWebService {
@GET
@Path("/getSession")
public Sessiondata getSession() {}
}

Changing @WebService @path to be "/UserService" results to:
---------------------------
ID: 2
Response-Code: 500
Encoding: UTF-8
Content-Type: text/xml
Headers: {}
Payload: <soap:Envelope xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>No
binding operation info while invoking unknown method with params
unknown.</faultstring></soap:Fault></soap:Body></soap:Envelope>
--------------------------------------

Thanks in advance for the help

-- 
WBR
Maxim aka solomax