You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by eax <er...@ik.bme.hu> on 2010/02/18 14:39:44 UTC

wsdl-first in CXF

Hi everybody,

I am new in CXF (but the topic of the web service is not new for me). I am
trying to write a CXF-WS with wsdl-first mode using CXFNonSpringServlet
based servlet.
I started from a wsdl, then I generated the classes. My first problem how to
set wsdllocation (actually this location is in WebContent/WEB-INF/wsdl
directory), because this set
 
factory.setWsdlLocation(getServletContext().getRealPath("/WEB-INF/wsdl/Echo.wsdl")); 
failed.
It is very interesting the tns in the starting wsdl is
targetNamespace="http://ws.test.bme.hu/" - while the tns gained from the
working service is targetNamespace="http://service.echo.bme.hu/"  - where
the packagename of the class implementing the service is
"hu.bme.echo.service".

Some help is highly appreciated, thanks.  A.
   
-- 
View this message in context: http://old.nabble.com/wsdl-first-in-CXF-tp27637719p27637719.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: wsdl-first in CXF

Posted by Daniel Kulp <dk...@apache.org>.
On Thu February 18 2010 8:39:44 am eax wrote:
> Hi everybody,
> 
> I am new in CXF (but the topic of the web service is not new for me). I am
> trying to write a CXF-WS with wsdl-first mode using CXFNonSpringServlet
> based servlet.
> I started from a wsdl, then I generated the classes. My first problem how
> to set wsdllocation (actually this location is in WebContent/WEB-INF/wsdl
> directory), because this set
> 
> factory.setWsdlLocation(getServletContext().getRealPath("/WEB-INF/wsdl/Echo
> .wsdl")); failed.
> It is very interesting the tns in the starting wsdl is
> targetNamespace="http://ws.test.bme.hu/" - while the tns gained from the
> working service is targetNamespace="http://service.echo.bme.hu/"  - where
> the packagename of the class implementing the service is
> "hu.bme.echo.service".
> 
> Some help is highly appreciated, thanks.  A.

It sounds like the call to getServletContext().getRealPath(...) is returning 
null and thus the service is being created as a "java first" case and 
generating a new wsdl.   The first thing I would do is debug that part.   Add 
something like:

System.out.println(getServletContext().getRealPath("/WEB-INF/wsdl/Echo.wsdl"))
or something to see that it's finding and such.


-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog