You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sergey Beryozkin <se...@iona.com> on 2007/09/12 13:20:20 UTC

RE: jaxws:endpoint wsdlLocation attribute -- form for class path reference?

Hi

I was about to ask a question if a wsdl document should always be located
inside WEB-INF/classes or WEB-INF/libs, and then I found this thread...

I agree it's a pain having to relocate a resource like
WEB-INF/wsdl/hello.wsdl into WEB-INF/classes/wsdl/hello.wsdl just to make it
work, esppecially when one deal with prepackaged wars.

Unfortunately I have little knowledge of Spring at this stage, but the idea
of using some Spring webapp-aware context classes looked promising so that
resources like "/WEB-INF/wsdl/hello.wsdl" could also be resolved. Is it
where CXFServlet can be enhanced a bit ?

By the way, I'm using Tomcat 5.5.25, Windows XP.

Thanks, Sergey


CMoesel wrote:
> 
> I ran into this very same issue when trying to run the war using the
> maven jetty plugin.  It also searched from the working directory instead
> of the root of the application context.  It worked however, when I tried
> it in Tomcat 5.5 and Jboss 4.0 standalone.
> 
> In order to get it working in the maven jetty plugin though, I had to
> put my wsdl in the classpath (WEB-INF/classes/myservice.wsdl) and then
> refer to it in the <jaxws:endpoint> as wsdlLocation="myservice.wsdl"
> (note the lack of "classpath:" prefix).
> 
> If you don't mind putting it in the classpath, that may be the best
> solution for you right now (assuming it works!).
> 
> -Chris
> 
> -----Original Message-----
> From: Steven E. Harris [mailto:seh@panix.com] 
> Sent: Wednesday, May 02, 2007 11:32 PM
> To: cxf-user@incubator.apache.org
> Subject: Re: jaxws:endpoint wsdlLocation attribute -- form for class
> path reference?
> 
> "Jiang, Ning \(Willem\)" <Ni...@iona.com> writes:
> 
>> I just try the latest kit's (build with latest trunk) helloworld
>> sample with the wsdlLocation="WEB-INF/wsdl/hello_world.wsdl".
>> 
>> It is workable. 
> 
> That's good to hear.
> 
>> Can you check your wsdl in the war or try the CXF helloworld sample?
> 
> Actually, I'm deploying via an explode WAR directory, but my WSDL is
> in the proper place in the directory. I just tried deploying via an
> actual WAR file as well. The files are in the directory and in the
> WAR. I tried matching your location specification above:
> "WEB-INF/wsdl/myfile.wsdl". No matter what, the search fails,
> apparently taking the current working directory as the base for the
> search:
> 
> Caused by: javax.wsdl.WSDLException: WSDLException:
> faultCode=PARSER_ERROR: Problem parsing 'WEB-INF/wsdl/myfile.wsdl'.:
> java.io.FileNotFoundException: C:\Program
> Files\Java\add-ons\apache-tomcat-6.0.10\bin\WEB-INF\wsdl\myfile.wsdl
> (The system cannot find the path specified)
> 	at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
> 	at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
> 	at
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.jav
> a:177)
> 	at
> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java
> :141)
> 	at
> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:
> 81)
> 	... 42 more
> Caused by: java.io.FileNotFoundException: C:\Program
> Files\Java\add-ons\apache-tomcat-6.0.10\bin\WEB-INF\wsdl\myfile.wsdl
> (The system cannot find the path specified)
> 	at java.io.FileInputStream.open(Native Method)
> 	at java.io.FileInputStream.<init>(FileInputStream.java:106)
> 	at java.io.FileInputStream.<init>(FileInputStream.java:66)
> 	at
> sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.ja
> va:70)
> 	at
> sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnec
> tion.java:161)
> 	at
> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEnt
> ity(XMLEntityManager.java:653)
> 	at
> com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocV
> ersion(XMLVersionDetector.java:186)
> 	at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
> 1Configuration.java:771)
> 	at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
> 1Configuration.java:737)
> 	at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.jav
> a:107)
> 	at
> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.jav
> a:225)
> 	at
> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Docume
> ntBuilderImpl.java:283)
> 	... 48 more
> 
> 
> If I start Tomcat from a shell, the same error arises, but the current
> working directory matches that of the shell that called startup.sh.
> 
> I'll give up for now and try again with tomorrow's snapshots.
> 
> -- 
> Steven E. Harris
> 
> 

-- 
View this message in context: http://www.nabble.com/jaxws%3Aendpoint-wsdlLocation-attribute----form-for-class-path-reference--tf3684247.html#a12633374
Sent from the cxf-user mailing list archive at Nabble.com.


Re: cxf servlet and jaxws:endpoint questions

Posted by Willem Jiang <ni...@iona.com>.
Hi Sergey,

There are some tricks in the CXF servlet transport.
Because we need to support the generate the service address dynamically 
with the different request, all the magical thing happened in the 
ServletController's updateDests method.
In this way,  we can support http://localhost/myapp/services/GreetMe and 
http://MyBox/myapp/services/GreetMe at the same time.

And jaxws:endpoint/@address just a suffix of the address.
If you specify the address with /services/GreetMe , you have to access 
the endpoint with the URL like
http://localhost/myapp/services/services/GreetMe

Willem.

Sergey Beryozkin wrote:
> HI
>
> Just a follow-up question...
> So is the rule of thumb is to use wildcard url patterns, like "/services/*" and then use jaxws:endpoint/@address
> values like "/GreetMe" ? 
>
> I'm wondering why specifying a pattern like "/services/GreetMe" doesn work...Casually glancing through a servler code didn't give me an answer so I'll probably have to look harder :-).
>
> Cheers, Sergey
>
>
> ----- Original Message ----- 
> From: "Sergey Beryozkin" <se...@iona.com>
> To: <cx...@incubator.apache.org>
> Sent: Wednesday, September 12, 2007 1:22 PM
> Subject: Re: cxf servlet and jaxws:endpoint questions
>
>
> Hi Chris
>
> It does work, super !
> Thanks for a quick reply,
> Sergey
>
> ----- Original Message ----- 
> From: "Christopher Moesel" <Ch...@avid.com>
> To: <cx...@incubator.apache.org>
> Sent: Wednesday, September 12, 2007 1:14 PM
> Subject: RE: cxf servlet and jaxws:endpoint questions
>
>
> Hi Sergey,
>
> The following combination *should* work...
>
> In web.xml, the url-pattern for the servlet-mapping:
> /hello/*
>
> In the jaxws:endpoint/@address:
> /world
>
> I believe that the difference between implementor and implementorClass
> is this:
>
> implementor: a reference to an *instance* of your SEI implementation (in
> Spring, you use this style: #myServiceEndpointImp)
>
> implementorClass: the fully qualified classname of your SEI
> implementation, which must have a default constructor (for example,
> com.mycompany.MyServiceEndpointImpl)
>
> I hope that helps!
>
> -Chris
>
> -----Original Message-----
> From: Sergey Beryozkin [mailto:sergey.beryozkin@iona.com] 
> Sent: Wednesday, September 12, 2007 7:55 AM
> To: cxf-user@incubator.apache.org
> Subject: cxf servlet and jaxws:endpoint questions
>
> Hi
>
> I have few questions with respect to deploying a cxf servlet into tomcat
> :
>
> * how to use/combine correctly a servlet's url pattern and an
> jaxws:endpoint/@address values ?
>
> For example, suppose I have a webapp "test" and I want my servlet to
> recognize this pattern : /hello/world
>
> As such, I'd like 
> GET http://localhost:8080/test/hello/world?wsdl 
>
> to return me a wsdl.
>
> In web.xml I've tried
> /hello/*
> /hello/world
>
> and in jaxws:endpoint/@address I tried
> /hello/world
> /world
>
> with no luck, the above request returns no service is available
>
> * what is the difference between jaxws:endpoint/@implementer and
> jaxws:endpoint/@implementerClass attributes ?
>
> Thanks, Sergey
>
>
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
> Ireland
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>
>   

Re: cxf servlet and jaxws:endpoint questions

Posted by Willem Jiang <ni...@iona.com>.
Hi Sergey,

It is a long story.
As you know jaxws:endpoint came form the RI's endpoint.xml, it only 
specifies the implementor's class name.
So jaxws:endpoint/@implementor support implementor class name and Spring 
bean's reference. 
Because of Spring 's AOP will use proxy to do some enhance work , if we 
specify a Spring bean's reference with the AOP involved , we can't get 
the SEI class from the implementor class.
And then we add the jaxws:endpoint/@implementorClass .

If you take a look at the ServerFactoryBean (CXF internal API) , You can 
take the directly mapping the implementor to the serviceBean  , and 
implementor class to the serviceClass.

Cheers,

Willem.

Sergey Beryozkin wrote:
> By the way, using jaxws:endpoint/@implementorClass does not work at all for me in a servlet env, but when I use 'implementor' to point to a fuly-qualified class then things are fine. I'm inclined to open a bug, is it really bug though ?
>
> Cheers, Sergey
>
> ----- Original Message ----- 
> From: "Sergey Beryozkin" <se...@iona.com>
> To: <cx...@incubator.apache.org>
> Sent: Wednesday, September 12, 2007 1:35 PM
> Subject: Re: cxf servlet and jaxws:endpoint questions
>
>
> HI
>
> Just a follow-up question...
> So is the rule of thumb is to use wildcard url patterns, like "/services/*" and then use jaxws:endpoint/@address
> values like "/GreetMe" ? 
>
> I'm wondering why specifying a pattern like "/services/GreetMe" doesn work...Casually glancing through a servler code didn't give me an answer so I'll probably have to look harder :-).
>
> Cheers, Sergey
>
>
> ----- Original Message ----- 
> From: "Sergey Beryozkin" <se...@iona.com>
> To: <cx...@incubator.apache.org>
> Sent: Wednesday, September 12, 2007 1:22 PM
> Subject: Re: cxf servlet and jaxws:endpoint questions
>
>
> Hi Chris
>
> It does work, super !
> Thanks for a quick reply,
> Sergey
>
> ----- Original Message ----- 
> From: "Christopher Moesel" <Ch...@avid.com>
> To: <cx...@incubator.apache.org>
> Sent: Wednesday, September 12, 2007 1:14 PM
> Subject: RE: cxf servlet and jaxws:endpoint questions
>
>
> Hi Sergey,
>
> The following combination *should* work...
>
> In web.xml, the url-pattern for the servlet-mapping:
> /hello/*
>
> In the jaxws:endpoint/@address:
> /world
>
> I believe that the difference between implementor and implementorClass
> is this:
>
> implementor: a reference to an *instance* of your SEI implementation (in
> Spring, you use this style: #myServiceEndpointImp)
>
> implementorClass: the fully qualified classname of your SEI
> implementation, which must have a default constructor (for example,
> com.mycompany.MyServiceEndpointImpl)
>
> I hope that helps!
>
> -Chris
>
> -----Original Message-----
> From: Sergey Beryozkin [mailto:sergey.beryozkin@iona.com] 
> Sent: Wednesday, September 12, 2007 7:55 AM
> To: cxf-user@incubator.apache.org
> Subject: cxf servlet and jaxws:endpoint questions
>
> Hi
>
> I have few questions with respect to deploying a cxf servlet into tomcat
> :
>
> * how to use/combine correctly a servlet's url pattern and an
> jaxws:endpoint/@address values ?
>
> For example, suppose I have a webapp "test" and I want my servlet to
> recognize this pattern : /hello/world
>
> As such, I'd like 
> GET http://localhost:8080/test/hello/world?wsdl 
>
> to return me a wsdl.
>
> In web.xml I've tried
> /hello/*
> /hello/world
>
> and in jaxws:endpoint/@address I tried
> /hello/world
> /world
>
> with no luck, the above request returns no service is available
>
> * what is the difference between jaxws:endpoint/@implementer and
> jaxws:endpoint/@implementerClass attributes ?
>
> Thanks, Sergey
>
>
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
> Ireland
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>
>   

Re: cxf servlet and jaxws:endpoint questions

Posted by Sergey Beryozkin <se...@iona.com>.
By the way, using jaxws:endpoint/@implementorClass does not work at all for me in a servlet env, but when I use 'implementor' to point to a fuly-qualified class then things are fine. I'm inclined to open a bug, is it really bug though ?

Cheers, Sergey

----- Original Message ----- 
From: "Sergey Beryozkin" <se...@iona.com>
To: <cx...@incubator.apache.org>
Sent: Wednesday, September 12, 2007 1:35 PM
Subject: Re: cxf servlet and jaxws:endpoint questions


HI

Just a follow-up question...
So is the rule of thumb is to use wildcard url patterns, like "/services/*" and then use jaxws:endpoint/@address
values like "/GreetMe" ? 

I'm wondering why specifying a pattern like "/services/GreetMe" doesn work...Casually glancing through a servler code didn't give me an answer so I'll probably have to look harder :-).

Cheers, Sergey


----- Original Message ----- 
From: "Sergey Beryozkin" <se...@iona.com>
To: <cx...@incubator.apache.org>
Sent: Wednesday, September 12, 2007 1:22 PM
Subject: Re: cxf servlet and jaxws:endpoint questions


Hi Chris

It does work, super !
Thanks for a quick reply,
Sergey

----- Original Message ----- 
From: "Christopher Moesel" <Ch...@avid.com>
To: <cx...@incubator.apache.org>
Sent: Wednesday, September 12, 2007 1:14 PM
Subject: RE: cxf servlet and jaxws:endpoint questions


Hi Sergey,

The following combination *should* work...

In web.xml, the url-pattern for the servlet-mapping:
/hello/*

In the jaxws:endpoint/@address:
/world

I believe that the difference between implementor and implementorClass
is this:

implementor: a reference to an *instance* of your SEI implementation (in
Spring, you use this style: #myServiceEndpointImp)

implementorClass: the fully qualified classname of your SEI
implementation, which must have a default constructor (for example,
com.mycompany.MyServiceEndpointImpl)

I hope that helps!

-Chris

-----Original Message-----
From: Sergey Beryozkin [mailto:sergey.beryozkin@iona.com] 
Sent: Wednesday, September 12, 2007 7:55 AM
To: cxf-user@incubator.apache.org
Subject: cxf servlet and jaxws:endpoint questions

Hi

I have few questions with respect to deploying a cxf servlet into tomcat
:

* how to use/combine correctly a servlet's url pattern and an
jaxws:endpoint/@address values ?

For example, suppose I have a webapp "test" and I want my servlet to
recognize this pattern : /hello/world

As such, I'd like 
GET http://localhost:8080/test/hello/world?wsdl 

to return me a wsdl.

In web.xml I've tried
/hello/*
/hello/world

and in jaxws:endpoint/@address I tried
/hello/world
/world

with no luck, the above request returns no service is available

* what is the difference between jaxws:endpoint/@implementer and
jaxws:endpoint/@implementerClass attributes ?

Thanks, Sergey



----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
Ireland

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Re: cxf servlet and jaxws:endpoint questions

Posted by Sergey Beryozkin <se...@iona.com>.
HI

Just a follow-up question...
So is the rule of thumb is to use wildcard url patterns, like "/services/*" and then use jaxws:endpoint/@address
values like "/GreetMe" ? 

I'm wondering why specifying a pattern like "/services/GreetMe" doesn work...Casually glancing through a servler code didn't give me an answer so I'll probably have to look harder :-).

Cheers, Sergey


----- Original Message ----- 
From: "Sergey Beryozkin" <se...@iona.com>
To: <cx...@incubator.apache.org>
Sent: Wednesday, September 12, 2007 1:22 PM
Subject: Re: cxf servlet and jaxws:endpoint questions


Hi Chris

It does work, super !
Thanks for a quick reply,
Sergey

----- Original Message ----- 
From: "Christopher Moesel" <Ch...@avid.com>
To: <cx...@incubator.apache.org>
Sent: Wednesday, September 12, 2007 1:14 PM
Subject: RE: cxf servlet and jaxws:endpoint questions


Hi Sergey,

The following combination *should* work...

In web.xml, the url-pattern for the servlet-mapping:
/hello/*

In the jaxws:endpoint/@address:
/world

I believe that the difference between implementor and implementorClass
is this:

implementor: a reference to an *instance* of your SEI implementation (in
Spring, you use this style: #myServiceEndpointImp)

implementorClass: the fully qualified classname of your SEI
implementation, which must have a default constructor (for example,
com.mycompany.MyServiceEndpointImpl)

I hope that helps!

-Chris

-----Original Message-----
From: Sergey Beryozkin [mailto:sergey.beryozkin@iona.com] 
Sent: Wednesday, September 12, 2007 7:55 AM
To: cxf-user@incubator.apache.org
Subject: cxf servlet and jaxws:endpoint questions

Hi

I have few questions with respect to deploying a cxf servlet into tomcat
:

* how to use/combine correctly a servlet's url pattern and an
jaxws:endpoint/@address values ?

For example, suppose I have a webapp "test" and I want my servlet to
recognize this pattern : /hello/world

As such, I'd like 
GET http://localhost:8080/test/hello/world?wsdl 

to return me a wsdl.

In web.xml I've tried
/hello/*
/hello/world

and in jaxws:endpoint/@address I tried
/hello/world
/world

with no luck, the above request returns no service is available

* what is the difference between jaxws:endpoint/@implementer and
jaxws:endpoint/@implementerClass attributes ?

Thanks, Sergey



----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
Ireland

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Re: cxf servlet and jaxws:endpoint questions

Posted by Sergey Beryozkin <se...@iona.com>.
Hi Chris

It does work, super !
Thanks for a quick reply,
Sergey

----- Original Message ----- 
From: "Christopher Moesel" <Ch...@avid.com>
To: <cx...@incubator.apache.org>
Sent: Wednesday, September 12, 2007 1:14 PM
Subject: RE: cxf servlet and jaxws:endpoint questions


Hi Sergey,

The following combination *should* work...

In web.xml, the url-pattern for the servlet-mapping:
/hello/*

In the jaxws:endpoint/@address:
/world

I believe that the difference between implementor and implementorClass
is this:

implementor: a reference to an *instance* of your SEI implementation (in
Spring, you use this style: #myServiceEndpointImp)

implementorClass: the fully qualified classname of your SEI
implementation, which must have a default constructor (for example,
com.mycompany.MyServiceEndpointImpl)

I hope that helps!

-Chris

-----Original Message-----
From: Sergey Beryozkin [mailto:sergey.beryozkin@iona.com] 
Sent: Wednesday, September 12, 2007 7:55 AM
To: cxf-user@incubator.apache.org
Subject: cxf servlet and jaxws:endpoint questions

Hi

I have few questions with respect to deploying a cxf servlet into tomcat
:

* how to use/combine correctly a servlet's url pattern and an
jaxws:endpoint/@address values ?

For example, suppose I have a webapp "test" and I want my servlet to
recognize this pattern : /hello/world

As such, I'd like 
GET http://localhost:8080/test/hello/world?wsdl 

to return me a wsdl.

In web.xml I've tried
/hello/*
/hello/world

and in jaxws:endpoint/@address I tried
/hello/world
/world

with no luck, the above request returns no service is available

* what is the difference between jaxws:endpoint/@implementer and
jaxws:endpoint/@implementerClass attributes ?

Thanks, Sergey



----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
Ireland

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

RE: cxf servlet and jaxws:endpoint questions

Posted by Christopher Moesel <Ch...@avid.com>.
Hi Sergey,

The following combination *should* work...

In web.xml, the url-pattern for the servlet-mapping:
/hello/*

In the jaxws:endpoint/@address:
/world

I believe that the difference between implementor and implementorClass
is this:

implementor: a reference to an *instance* of your SEI implementation (in
Spring, you use this style: #myServiceEndpointImp)

implementorClass: the fully qualified classname of your SEI
implementation, which must have a default constructor (for example,
com.mycompany.MyServiceEndpointImpl)

I hope that helps!

-Chris

-----Original Message-----
From: Sergey Beryozkin [mailto:sergey.beryozkin@iona.com] 
Sent: Wednesday, September 12, 2007 7:55 AM
To: cxf-user@incubator.apache.org
Subject: cxf servlet and jaxws:endpoint questions

Hi

I have few questions with respect to deploying a cxf servlet into tomcat
:

* how to use/combine correctly a servlet's url pattern and an
jaxws:endpoint/@address values ?

For example, suppose I have a webapp "test" and I want my servlet to
recognize this pattern : /hello/world

As such, I'd like 
GET http://localhost:8080/test/hello/world?wsdl 

to return me a wsdl.

In web.xml I've tried
/hello/*
/hello/world

and in jaxws:endpoint/@address I tried
/hello/world
/world

with no luck, the above request returns no service is available

* what is the difference between jaxws:endpoint/@implementer and
jaxws:endpoint/@implementerClass attributes ?

Thanks, Sergey



----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
Ireland

cxf servlet and jaxws:endpoint questions

Posted by Sergey Beryozkin <se...@iona.com>.
Hi

I have few questions with respect to deploying a cxf servlet into tomcat :

* how to use/combine correctly a servlet's url pattern and an jaxws:endpoint/@address values ?

For example, suppose I have a webapp "test" and I want my servlet to recognize this pattern : /hello/world

As such, I'd like 
GET http://localhost:8080/test/hello/world?wsdl 

to return me a wsdl.

In web.xml I've tried
/hello/*
/hello/world

and in jaxws:endpoint/@address I tried
/hello/world
/world

with no luck, the above request returns no service is available

* what is the difference between jaxws:endpoint/@implementer and  jaxws:endpoint/@implementerClass attributes ?

Thanks, Sergey



----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Re: jaxws:endpoint wsdlLocation attribute -- form for class path reference?

Posted by Sergey Beryozkin <se...@iona.com>.
phew...I thought I was going to loose my mind. I had two webapps, absolutely identical in structure,

one loading "WEB-INF/wsdl/hello.wsdl" just fine yet another one failing to load "WEB-INF/wsdl/greetMe.wsdl".
cxf-servlet.xmls were absolutely identical in format too...or so I thought.
Fortunately, I was saved, I was pointed out that one cxf-servlet.xml had the following import statements, which I copied from the docs :

<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"/>

These import statements upset CXFServler and "WEB-INF/wsdl/greetMe.wsdl" can not be loaded.
Without these imports "WEB-INF/wsdl/greetMe.wsdl" is loaded just fine...

Cheers, Sergey


----- Original Message ----- 
From: "Sergey Beryozkin" <se...@iona.com>
To: <cx...@incubator.apache.org>
Sent: Thursday, September 13, 2007 12:19 PM
Subject: Re: jaxws:endpoint wsdlLocation attribute -- form for class path reference?


I have CXFServlet loading "WEB-INF/wsdl/hello.wsdl" just fine. not sure why it didn't work for me yesterday,
possibly because I was using an absolute "/WEB-INF/wsdl/hello.wsdl" form... So things are cool.

Cheers, Sergey





> 
> Hi
> 
> I was about to ask a question if a wsdl document should always be located
> inside WEB-INF/classes or WEB-INF/libs, and then I found this thread...
> 
> I agree it's a pain having to relocate a resource like
> WEB-INF/wsdl/hello.wsdl into WEB-INF/classes/wsdl/hello.wsdl just to make it
> work, esppecially when one deal with prepackaged wars.
> 
> Unfortunately I have little knowledge of Spring at this stage, but the idea
> of using some Spring webapp-aware context classes looked promising so that
> resources like "/WEB-INF/wsdl/hello.wsdl" could also be resolved. Is it
> where CXFServlet can be enhanced a bit ?
> 
> By the way, I'm using Tomcat 5.5.25, Windows XP.
> 
> Thanks, Sergey
> 
> 
> CMoesel wrote:
>> 
>> I ran into this very same issue when trying to run the war using the
>> maven jetty plugin.  It also searched from the working directory instead
>> of the root of the application context.  It worked however, when I tried
>> it in Tomcat 5.5 and Jboss 4.0 standalone.
>> 
>> In order to get it working in the maven jetty plugin though, I had to
>> put my wsdl in the classpath (WEB-INF/classes/myservice.wsdl) and then
>> refer to it in the <jaxws:endpoint> as wsdlLocation="myservice.wsdl"
>> (note the lack of "classpath:" prefix).
>> 
>> If you don't mind putting it in the classpath, that may be the best
>> solution for you right now (assuming it works!).
>> 
>> -Chris
>> 
>> -----Original Message-----
>> From: Steven E. Harris [mailto:seh@panix.com] 
>> Sent: Wednesday, May 02, 2007 11:32 PM
>> To: cxf-user@incubator.apache.org
>> Subject: Re: jaxws:endpoint wsdlLocation attribute -- form for class
>> path reference?
>> 
>> "Jiang, Ning \(Willem\)" <Ni...@iona.com> writes:
>> 
>>> I just try the latest kit's (build with latest trunk) helloworld
>>> sample with the wsdlLocation="WEB-INF/wsdl/hello_world.wsdl".
>>> 
>>> It is workable. 
>> 
>> That's good to hear.
>> 
>>> Can you check your wsdl in the war or try the CXF helloworld sample?
>> 
>> Actually, I'm deploying via an explode WAR directory, but my WSDL is
>> in the proper place in the directory. I just tried deploying via an
>> actual WAR file as well. The files are in the directory and in the
>> WAR. I tried matching your location specification above:
>> "WEB-INF/wsdl/myfile.wsdl". No matter what, the search fails,
>> apparently taking the current working directory as the base for the
>> search:
>> 
>> Caused by: javax.wsdl.WSDLException: WSDLException:
>> faultCode=PARSER_ERROR: Problem parsing 'WEB-INF/wsdl/myfile.wsdl'.:
>> java.io.FileNotFoundException: C:\Program
>> Files\Java\add-ons\apache-tomcat-6.0.10\bin\WEB-INF\wsdl\myfile.wsdl
>> (The system cannot find the path specified)
>> at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
>> at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>> at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>> at
>> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.jav
>> a:177)
>> at
>> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java
>> :141)
>> at
>> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:
>> 81)
>> ... 42 more
>> Caused by: java.io.FileNotFoundException: C:\Program
>> Files\Java\add-ons\apache-tomcat-6.0.10\bin\WEB-INF\wsdl\myfile.wsdl
>> (The system cannot find the path specified)
>> at java.io.FileInputStream.open(Native Method)
>> at java.io.FileInputStream.<init>(FileInputStream.java:106)
>> at java.io.FileInputStream.<init>(FileInputStream.java:66)
>> at
>> sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.ja
>> va:70)
>> at
>> sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnec
>> tion.java:161)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEnt
>> ity(XMLEntityManager.java:653)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocV
>> ersion(XMLVersionDetector.java:186)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
>> 1Configuration.java:771)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
>> 1Configuration.java:737)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.jav
>> a:107)
>> at
>> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.jav
>> a:225)
>> at
>> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Docume
>> ntBuilderImpl.java:283)
>> ... 48 more
>> 
>> 
>> If I start Tomcat from a shell, the same error arises, but the current
>> working directory matches that of the shell that called startup.sh.
>> 
>> I'll give up for now and try again with tomorrow's snapshots.
>> 
>> -- 
>> Steven E. Harris
>> 
>> 
> 
> -- 
> View this message in context: http://www.nabble.com/jaxws%3Aendpoint-wsdlLocation-attribute----form-for-class-path-reference--tf3684247.html#a12633374
> Sent from the cxf-user mailing list archive at Nabble.com.

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Re: jaxws:endpoint wsdlLocation attribute -- form for class path reference?

Posted by Sergey Beryozkin <se...@iona.com>.
I have CXFServlet loading "WEB-INF/wsdl/hello.wsdl" just fine. not sure why it didn't work for me yesterday,
possibly because I was using an absolute "/WEB-INF/wsdl/hello.wsdl" form... So things are cool.

Cheers, Sergey





> 
> Hi
> 
> I was about to ask a question if a wsdl document should always be located
> inside WEB-INF/classes or WEB-INF/libs, and then I found this thread...
> 
> I agree it's a pain having to relocate a resource like
> WEB-INF/wsdl/hello.wsdl into WEB-INF/classes/wsdl/hello.wsdl just to make it
> work, esppecially when one deal with prepackaged wars.
> 
> Unfortunately I have little knowledge of Spring at this stage, but the idea
> of using some Spring webapp-aware context classes looked promising so that
> resources like "/WEB-INF/wsdl/hello.wsdl" could also be resolved. Is it
> where CXFServlet can be enhanced a bit ?
> 
> By the way, I'm using Tomcat 5.5.25, Windows XP.
> 
> Thanks, Sergey
> 
> 
> CMoesel wrote:
>> 
>> I ran into this very same issue when trying to run the war using the
>> maven jetty plugin.  It also searched from the working directory instead
>> of the root of the application context.  It worked however, when I tried
>> it in Tomcat 5.5 and Jboss 4.0 standalone.
>> 
>> In order to get it working in the maven jetty plugin though, I had to
>> put my wsdl in the classpath (WEB-INF/classes/myservice.wsdl) and then
>> refer to it in the <jaxws:endpoint> as wsdlLocation="myservice.wsdl"
>> (note the lack of "classpath:" prefix).
>> 
>> If you don't mind putting it in the classpath, that may be the best
>> solution for you right now (assuming it works!).
>> 
>> -Chris
>> 
>> -----Original Message-----
>> From: Steven E. Harris [mailto:seh@panix.com] 
>> Sent: Wednesday, May 02, 2007 11:32 PM
>> To: cxf-user@incubator.apache.org
>> Subject: Re: jaxws:endpoint wsdlLocation attribute -- form for class
>> path reference?
>> 
>> "Jiang, Ning \(Willem\)" <Ni...@iona.com> writes:
>> 
>>> I just try the latest kit's (build with latest trunk) helloworld
>>> sample with the wsdlLocation="WEB-INF/wsdl/hello_world.wsdl".
>>> 
>>> It is workable. 
>> 
>> That's good to hear.
>> 
>>> Can you check your wsdl in the war or try the CXF helloworld sample?
>> 
>> Actually, I'm deploying via an explode WAR directory, but my WSDL is
>> in the proper place in the directory. I just tried deploying via an
>> actual WAR file as well. The files are in the directory and in the
>> WAR. I tried matching your location specification above:
>> "WEB-INF/wsdl/myfile.wsdl". No matter what, the search fails,
>> apparently taking the current working directory as the base for the
>> search:
>> 
>> Caused by: javax.wsdl.WSDLException: WSDLException:
>> faultCode=PARSER_ERROR: Problem parsing 'WEB-INF/wsdl/myfile.wsdl'.:
>> java.io.FileNotFoundException: C:\Program
>> Files\Java\add-ons\apache-tomcat-6.0.10\bin\WEB-INF\wsdl\myfile.wsdl
>> (The system cannot find the path specified)
>> at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
>> at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>> at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>> at
>> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.jav
>> a:177)
>> at
>> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java
>> :141)
>> at
>> org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:
>> 81)
>> ... 42 more
>> Caused by: java.io.FileNotFoundException: C:\Program
>> Files\Java\add-ons\apache-tomcat-6.0.10\bin\WEB-INF\wsdl\myfile.wsdl
>> (The system cannot find the path specified)
>> at java.io.FileInputStream.open(Native Method)
>> at java.io.FileInputStream.<init>(FileInputStream.java:106)
>> at java.io.FileInputStream.<init>(FileInputStream.java:66)
>> at
>> sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.ja
>> va:70)
>> at
>> sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnec
>> tion.java:161)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEnt
>> ity(XMLEntityManager.java:653)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocV
>> ersion(XMLVersionDetector.java:186)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
>> 1Configuration.java:771)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML1
>> 1Configuration.java:737)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.jav
>> a:107)
>> at
>> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.jav
>> a:225)
>> at
>> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Docume
>> ntBuilderImpl.java:283)
>> ... 48 more
>> 
>> 
>> If I start Tomcat from a shell, the same error arises, but the current
>> working directory matches that of the shell that called startup.sh.
>> 
>> I'll give up for now and try again with tomorrow's snapshots.
>> 
>> -- 
>> Steven E. Harris
>> 
>> 
> 
> -- 
> View this message in context: http://www.nabble.com/jaxws%3Aendpoint-wsdlLocation-attribute----form-for-class-path-reference--tf3684247.html#a12633374
> Sent from the cxf-user mailing list archive at Nabble.com.

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland