Jboss+jbossws-cxf-3.4.1.GA and spring 3.0.5 : how to publish a cxf web service instantiated in spring
aminem Jun 15, 2011 4:24 AMHi,
As part of a project, i should use Jboss+jbossws-cxf-3.4.1.GA and spring 3.0.5. Problem : I'am newbie on JBoss
After some researchs, and according of Jboss-CXF and apache-Cxf documentation it seem that some important difference exist to configure cxf+spring when it is integrated to Jboss 6.0 final.
In order to understand how is it running, i developed a web service in a maven project :
package example; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebParam.Mode; import javax.jws.WebResult; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; import javax.jws.soap.SOAPBinding.Style; import javax.jws.soap.SOAPBinding.Use; @WebService(name = "AuthenticateWS", portName = "AuthenticatePort", serviceName = "AuthenticateService") @SOAPBinding(style=Style.DOCUMENT, use=Use.LITERAL) public class AuthenticateWS { public AuthenticateWS(){ } @WebMethod(operationName = "authenticate") @WebResult(partName = "authenticateResponse", name = "id_user", targetNamespace = "client.clirisgroup.com") public int authenticate( @WebParam(mode = Mode.IN, name = "login", partName = "authenticateRequest") String login, @WebParam(mode = Mode.IN, name = "password", partName = "authenticateRequest") String password) { return -1; } @WebMethod(operationName="resetAccount") @WebResult(name="resetSucceed", partName="resetAccountResponse", targetNamespace="client.clirisgroup.com") public int resetAccount(@WebParam(mode = Mode.IN, name = "email", partName = "resetAccountRequest")String email){ return -1; } }
my WBE-INF/beans.xml file contains the following code :
<beans xmlns='http://www.springframework.org/schema/beans' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:beans='http://www.springframework.org/schema/beans' xmlns:jaxws='http://cxf.apache.org/jaxws' xsi:schemaLocation='http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd'> <jaxws:endpoint id="AuthenticateEndPoint" implementor="example.AuthenticateWS" address="http://@jboss.bind.address@:8080/portal-services/AuthenticateEndPoint" publish="true" > <jaxws:invoker> <bean class='org.jboss.wsf.stack.cxf.InvokerJSE' /> </jaxws:invoker> </jaxws:endpoint> </beans>
and my WEB-INF/web.xml contains nothing :
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <!-- xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" --> <display-name>example</display-name> </web-app>
i don't have error when i deploy my web service on the server (*.war packaging). But i note that my web service (declared in beans.xml) is not published even if i set publish="true".
Also i don't found my web service in my JBoss Web Services Console. I suppose that There's something I don't get.
Can you help me, please.
Thank you in advance.
Some info:
I use JBoss 6.0 final.
i compiled installed with the flag -Dspring=true
I added spring libs to <JBOSS_HOME>/common/lib