cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Mazza <glen.ma...@gmail.com>
Subject Re: How to host CXF webservice in Tomcat war
Date Sun, 18 Aug 2013 15:30:57 GMT
Thanks all for the kind words.

Glen

On 08/18/2013 11:25 AM, Mark Streit wrote:
> IMO ... The Glen Mazza blog on web services  has to be the most
> complete, detailed and well-documented info I have seen on the topic.
>
> I can't tell you how many times I've passed the link on both externally and
> internally to teams in my company.
>
> A great job as always.
>
> On Sunday, August 18, 2013, David Blevins wrote:
>
>> Hi David!
>>
>> You might also check out TomEE which is Tomcat with CXF integrated.  Here's
>> a demo from JAXConf this June that shows a simple web service.  Skip to 21
>> minutes in to see the @WebService part.
>>
>>   -
>> http://jaxenter.com/apache-tomee-javaee-6-web-profile-on-tomcat-47873.html
>>
>> Glen, truly impressive blog you have!  Wow.
>>
>>
>> -David
>>
>>
>>
>> On Fri, Aug 16, 2013 at 9:23 PM, David Hoffer <dhoffer6@gmail.com<javascript:;>>
>> wrote:
>>
>>> I have a CXF webservice that I need to now host in Tomcat webapp.  I'm
>>> using the 'code first' approach where I have Java pojos, annotated for
>> CXF
>>> webservice, e.g.
>>>
>>> @WebService()
>>> @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use =
>>> SOAPBinding.Use.LITERAL)
>>> @XmlJavaTypeAdapter(WebServiceAPIAdapter.class)
>>> public interface IWebServiceAPI {
>>>      public WebOutput calc(@WebParam(name = "webInput") WebInput
>> webInput);
>>> }
>>>
>>> Which previously I hosted in standalone Jetty server, e.g.
>>>
>>> WebServiceAPI implementor = new WebServiceAPI();
>>> JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
>>> svrFactory.setServiceClass(IWebServiceAPI.class);
>>> svrFactory.setAddress("http://IP:port/namespace");
>>> svrFactory.setServiceBean(implementor);
>>> server = svrFactory.create();
>>>
>>> That all works well but now I need to do the same in Tomcat, so I assume
>>> the code and @WebService annotation is the same?  But how do I now
>>> host/deploy this in war?  E.g. I don't need any server with IP
>> address/etc.
>>>   Rather I want to deploy in war so IP:port is already defined by the
>>> container just need the rest of this.
>>>
>>> How do I transition to Tomcat/war?
>>>
>>> Also I might mention that I need the resulting auto generated WSDL to
>>> generate schema for the WebOutput result object as that is a nested Java
>>> POJO...again this works fine in standalone Jetty server just need the
>> same
>>> in war.
>>>
>


Mime
View raw message