Hi All,
I currently have a service which I want to expose as both ReST(ian/ful)
and SOAP.
AccountService.java:
@Path("/rest/Accounts")
public class AccountService {
@GET
@Path("/Account/{uniqueId}")
public Account get(
@PathParam("uniqueId")
long uniqueId
) {
System.out.println("got in");
logger.info("get received: " + uniqueId);
try{
return generateAccount();
} finally {
}
}
}
beans.xml:
<jaxrs:server id="accountRestService" address="/">
<jaxrs:serviceBeans>
<ref bean="accountServiceClass" />
</jaxrs:serviceBeans>
</jaxrs:server>
<bean id="accountServiceClass" class="my.package.AccountService" />
<jaxws:endpoint
id="accountSoapService"
address="/soap/Accounts"
implementor="#accountServiceClass"
>
</jaxws:endpoint>
** As stated in http://cwiki.apache.org/CXF20DOC/jax-rs-jsr-311.html
The ReST part works fine. However, there seems to be problem with the
soap part. The wsdl is all messed up, no object/method definitions,
nothing from what you would expect from a standard SOAP wsdl.
I could be missing some parameters/settings/properties in the jaxws tag.
Or do I mix both jax-rs and jax-ws annotations?
@GET
@Path("/Account/{uniqueId}")
@WebMethod(operationName="get")
public Account get(
@WebParam(name="uniqueId")
long uniqueId
Initially, I had everything using jax-ws. I used http-binding for the
ReST part and let the default settings handle the SOAP part. But as
advised in my previous question
(http://www.nabble.com/-REST--HTTP-BINDING-Service-does-not-receive-Post-parameter-tt19986914.html#a19991022),
so now I am trying to have it in jax-rs-ws tandem.
Again, thanks in advance.
P.S.
This is also a sort of follow-up regarding the issue raised in this
other thread:
(CXF-1695) Service listings for JAX-RS endpoints
(http://www.nabble.com/Created%3A-%28CXF-1695%29-Service-listings-for-JAX-RS-endpoints-tt18363145.html#a18363145)