aspose file tools*
The moose likes Web Services and the fly likes What is the proper use of @WebService.wsdlLocation to specify the location of my WSDL file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "What is the proper use of @WebService.wsdlLocation to specify the location of my WSDL file?" Watch "What is the proper use of @WebService.wsdlLocation to specify the location of my WSDL file?" New topic
Author

What is the proper use of @WebService.wsdlLocation to specify the location of my WSDL file?

Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 642
I'm developing a simple web service as a stateless EJB using Eclipse, JDK 1.6.0_06 and deploying to JBoss AS 5.1.0.GA
The generated WSDL has the wrong service address in the Port element and I'm not sure yet how to correct it.

What I thought I would do in the mean time is to hand-correct the WSDL and reference the corrected version in the @WebService annotation using the wsdlLocation member. However, I can't seem to specify the location of the WSDL in a way that the JBoss application server deployer likes.

From what I've read, I should be able to provide a full URL to the WSDL, as http://host/path/myService.wsdl, but the deployment fails with the following error:

Note that if I go to the URL, I get the WSDL file.

I tried placing the file in a wsdl directory under the META-INF directory of the EAR and ejb-jar, but none of these work.

I think I'm probably misunderstanding what this annotation member is used for.

Thanks,
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
I have successfully used the following setup when specifying an existing WSDL in the @WebService annotation:
- In the WEB-INF, I created a directory named "wsdl" (without quotes, of course).
- Then I copied the WSDL to the WEB-INF/wsdl directory.
- In the @WebService annotation, using the wsdlLocation attribute, I just give the name of the WSDL file. Example: @WebService(wsdlLocation="MyService.wsdl")
Best wishes!
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 642
Ivan Krizsan wrote:Hi!
I have successfully used the following setup when specifying an existing WSDL in the @WebService annotation:
- In the WEB-INF, I created a directory named "wsdl" (without quotes, of course).
- Then I copied the WSDL to the WEB-INF/wsdl directory.
- In the @WebService annotation, using the wsdlLocation attribute, I just give the name of the WSDL file. Example: @WebService(wsdlLocation="MyService.wsdl")
Best wishes!

Thanks, but this still doesn't work in my case. I wonder if our applications are a similar-enough architecture.
I have a J2EE application which consists of some EJBs in an ejb-jar component, and a servlet in a web component.
The stateless session bean on which I have place the @WebService() annotation is in the ejb-jar component, and of course, an ejb-jar doesn't have a WEB-INF directory.
However, I placed the WSDL file in the web component's WEB-INF/wsdl directory and tried it anyway, but get the same error.
I also tried placing the WSDL file in the META-INF/wsdl directory of the ejb-jar as well as the META-INF/wsdl directory of the Ear, and got the same error in all cases.

Thanks,
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi again!
Take a look at the following example: http://community.jboss.org/wiki/JBossWS-NativeUserGuide#Setup_an_event_source_endpoint
Hope it works!
markendef allen
Greenhorn

Joined: Jan 09, 2010
Posts: 2
Thanks For Sharing

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: What is the proper use of @WebService.wsdlLocation to specify the location of my WSDL file?
 
Similar Threads
security
EJB 5.0 deploy
How do I correct the location address in my generated WSDL?
JAX-WS
Unable to use @NamedQuery in a session bean?