rogelgarcia 13 de abr. de 2010
É possivel… mas vc terá que usar alguma biblioteca… a documentação do spring tem informacoes sobre a utilizacao do CXF…
Olhe a documentação do Spring sobre web services… de qualquer maneira, você terá que configurar num XML do Spring o endpoint… exemplo:
< ? xml version = "1.0" encoding = "UTF-8" ? >
< beans xmlns = "http://www.springframework.org/schema/beans"
xmlns : xsi = "http://www.w3.org/2001/XMLSchema-instance"
xmlns : jaxws = "http://cxf.apache.org/jaxws"
xsi : schemaLocation = "
http : // www . springframework . org / schema / beans http : // www . springframework . org / schema / beans / spring - beans - 2.0 . xsd
http : // cxf . apache . org / jaxws http : // cxf . apache . org / schemas / jaxws . xsd ">
< 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" />
< ! --
Para utilizar webservices , é necessária fazer a referencia via XML .
O código do XML é padrão com exceção da tag abaixo , que faz com que o
webservice seja inicializado em determinada URL
-->
< jaxws : endpoint
implementor = "pacote.Teste"
address = "/meuwebservice" />
</ beans >
O web service e o DAO serão beans normais… então o Spring faz a injeçao
ralphsilver 13 de abr. de 2010
rogelgarcia:
É possivel.. mas vc terá que usar alguma biblioteca.. a documentação do spring tem informacoes sobre a utilizacao do CXF...
Olhe a documentação do Spring sobre web services.. de qualquer maneira, você terá que configurar num XML do Spring o endpoint.. exemplo:
< ? xml version = "1.0" encoding = "UTF-8" ? >
< beans xmlns = "http://www.springframework.org/schema/beans"
xmlns : xsi = "http://www.w3.org/2001/XMLSchema-instance"
xmlns : jaxws = "http://cxf.apache.org/jaxws"
xsi : schemaLocation = "
http : // www . springframework . org / schema / beans http : // www . springframework . org / schema / beans / spring - beans - 2.0 . xsd
http : // cxf . apache . org / jaxws http : // cxf . apache . org / schemas / jaxws . xsd ">
< 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" />
< ! --
Para utilizar webservices , é necessária fazer a referencia via XML .
O código do XML é padrão com exceção da tag abaixo , que faz com que o
webservice seja inicializado em determinada URL
-->
< jaxws : endpoint
implementor = "pacote.Teste"
address = "/meuwebservice" />
</ beans >
O web service e o DAO serão beans normais.. então o Spring faz a injeçao
Valew pela dica... botei pra implementar e pegou.. só que tá dando esse erro que eu não consigo tirar de jeito nenhum:
javax.naming.NameNotFoundException: bus not found
segue meu applicationContext:
< ! -- CONFIGURACAO DO WEB SERVICE -->
< 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" />
< cxf : bus >
< cxf : features >
< cxf : logging />
</ cxf : features >
</ cxf : bus >
< ! -- Aegis data binding -->
< bean id = "aegisBean"
class = "org.apache.cxf.aegis.databinding.AegisDatabinding"
scope = "prototype" />
< bean id = "jaxws-and-aegis-service-factory"
class = "org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"
scope = "prototype" >
< property name = "dataBinding" ref = "aegisBean" />
< property name = "serviceConfigurations" >
< list >
< bean class = "org.apache.cxf.jaxws.support.JaxWsServiceConfiguration" />
< bean class = "org.apache.cxf.aegis.databinding.AegisServiceConfiguration" />
< bean class = "org.apache.cxf.service.factory.DefaultServiceConfiguration" />
</ list >
</ property >
</ bean >
< ! -- Service endpoint -->
< ! -- See http : // incubator . apache . org / cxf / faq . html regarding CXF + Spring AOP -->
< jaxws : endpoint id = "usuarioService"
implementor = "#usuarioFacade"
address = "/UsuarioFacadeService" >
< jaxws : serviceFactory >
< ref bean = "jaxws-and-aegis-service-factory" />
</ jaxws : serviceFactory >
</ jaxws : endpoint >
rogelgarcia 13 de abr. de 2010
Agora eu nao sei
Tenta tirar isso
<cxf:bus>
<cxf:features>
<cxf:logging/>
</cxf:features>
</cxf:bus>
ralphsilver 13 de abr. de 2010
rogelgarcia:
Agora eu nao sei
Tenta tirar isso
<cxf:bus>
<cxf:features>
<cxf:logging/>
</cxf:features>
</cxf:bus>
Já tentei… por acaso vc tem a url ou o lugar de onde vc tirou para eu tentar ver se consigo?.. estou pelejando e já vi várias formas… mas nenhuma deu certo =/
rogelgarcia 13 de abr. de 2010
ralphsilver 14 de abr. de 2010
Falae beleza?
oww… eu testei aqui… eu não sei o que vc usa como application server…mas no glassfish 3 ele funcionou… aqui na empresa eu precisaria que rodasse no glassfish 2 …
Valew aí pela força
rogelgarcia 14 de abr. de 2010
Eu costumo usar o Tomcat … ou JBoss…
Vlw