Reputation: 584
I try to implement a consumer for my jax-ws @Stateless @WebService bean webservice. The service runs fine and I can successfully test it using NetBeans's/GlassFish's webservice testing functionality.
The consumer is a Servlet deployed with the same ear as the service. I inject the service using
@WebServiceRef(wsdlLocation = "http://localhost:8080/EchoService/EchoBean?wsdl")
EchoService echo;
but whenever I open the servlet all I get is a stack trace with the following root exception
java.io.FileNotFoundException:
http://localhost:8080/EchoService/EchoBean/__container$publishing$subctx/null?WSDL
I can load the WSDL from http://localhost:8080/EchoService/EchoBean/?WSDL
in the browser but I have no clue about the __container$publishing$subctx/null
part, which is not mentioned anywhere in my code.
The full stack trace is available at http://pastebin.com/dneCPj8z
Any help would be greatly appreciated!
Upvotes: 1
Views: 3463
Reputation: 389
In your project, under:
"Your project name"/Configuration Files/xml-resources/web-service-references/"Your web service name"/wsdl/
copy the "localhost_8080" folder and paste it under:
"Your project name"/Web pages/WEB-INF/wsdl.
also change:
@WebServiceRef(wsdlLocation = "http://localhost:8080/EchoService/EchoBean.wsdl")
to:
@WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8080/EchoService/EchoBean.wsdl")
Upvotes: 0
Reputation: 15261
If you are using Glassfish 4, @WebServiceRef
annotation does not work properly on servlets and filters. This is filed under GLASSFISH-20740. Check this thread.
HTH
Upvotes: 1