-
1. Re: @WebServiceRef and JB AS 7.1.x re-borked?
jaikiran Nov 23, 2011 5:58 AM (in response to fwelland)Could you please try this against AS 7.1.0 Beta1 which was released today? If it doesn't work there, please post some relevant code.
-
2. Re: @WebServiceRef and JB AS 7.1.x re-borked?
fwelland Nov 23, 2011 9:59 AM (in response to jaikiran)It is working better. I can probably do some tinkering around abit with my WAR structure, jax-ws-catalog.xml and how I reference my services & come up with a solution that works for both jboss as 7.1 and GF and seems to follow the ee6 specs.
The specific sticking point I have now is:
my service wsdl is at, in the cannoical sense: http://mycompany.com/HelloWSWorld/Hello/Hello?wsdl.
In "development mode", I have a webservice that honors this wsdl but at service end point address:
"http://localhost:8080/HelloWSWorld/Hello/Hello"
I have a jax-ws-catalog.xml that maps the wsdl reference like so:
<system systemId="http://mycompany.com/HelloWSWorld/Hello/Hello?wsdl" uri="wsdl/Hello.wsdl"/>
The jax-ws-catalog.xml is in both WEB-INF and WEB-INF/classes/META-INF/ with a wsdl/Hello.wsdl file relatvie to both locations (of jax ws catalog).
In my jsf managed bean, I have the following instance variable declarations:
@WebServiceRef(wsdlLocation = "http://mycompany.com/HelloWSWorld/Hello/Hello?wsdl")
private Hello_Service service;
private goober.ws.Hello port;
I also have a @PostContruct() method in this managed bean like this:
@PostConstruct
private void init()
{
System.out.println("in post construct going to provide the overrides...");
if(null == service)
{
System.out.println("I am a sad goober; because service seems null, I will just crash...");
}
else
{
System.out.println("I am a happy goober, service is not null");
if(isDev)
{
port = service.getHelloPort();
BindingProvider bp = (BindingProvider)port;
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,"http://localhost:8080/HelloWSWorld/Hello/Hello");
}
}
}
I think you see the basic pattern: we code assuming the cannoical location of our service and in development environments we override this service end point with a local one...etc etc etc.
In GF (3.1.1) this strategy works. In 7.1.0beta1, the @WebServiceRef seems to want to really resolve "http://mycompany.com/HelloWSWorld/Hello/Hello?wsdl" instead of using the mapping specified in the jax-ws-catalog.xml.
So now it seems (with jboss as 7.1.0beta1), if I have a resolvable location 'in' the @WebServiceRef(wsdlLocation = "...") annotation to either file ref like "wsdl/Hello.wsdl" or a run-time resolvable reference like: "http://localhost:8080/HelloWSWorld/Hello/Hello?wsdl" then the @WebServiceRef seems ok (and presumably the end-point reassignment too ).
So it is like the jax-ws-catalog is not being used in jboss as 7.1.0beta1.
Perhaps:
I have the catalog in the wrong location?
My expectations are wrong for @WebServiceRef() and jax-ws-catalog.xml?
There is a config issue in my WAR or in AS7 that I need to tinker with make the jax-ws-catalog work?
Any advise on this would be much appreciated.
-
3. Re: @WebServiceRef and JB AS 7.1.x re-borked?
ropalka Nov 23, 2011 10:17 AM (in response to fwelland)This is a bug. Could U create a JIRA here
https://issues.jboss.org/browse/JBWS
and provide simple test case that works on GF?
-
4. Re: @WebServiceRef and JB AS 7.1.x re-borked?
fwelland Nov 23, 2011 4:41 PM (in response to ropalka)Opened as issue: https://issues.jboss.org/browse/JBWS-3390
-
5. Re: @WebServiceRef and JB AS 7.1.x re-borked?
fwelland Nov 23, 2011 6:27 PM (in response to ropalka)So the problem may even be deeper than just ignoring the jax-ws-catalog.xml file.
After taking what I learned from the sample WAR attached to the issue; I applied that to my real application. Unlike the sample application whose, JSF managed bean is the class that uses @WebServiceRef() and makes the WS call...the real application does this:
JSF Managed bean delegates to a different class (call it 'dal') that is @Inject() by the managed bean. This dal class does the @WebServiceRef() and then makes the WS calls.
@WebServiceRef in this DAL doesn't seem to work at all in this case. Even when I explictly refer to a WSDL like this (as :
@WebServiceRef(wsdlLocation = "/WEB-INF/wsdl/TemplateService.wsdl")
private com.blah.blah.template.TemplateServiceService service;
As mentioned in the issue, A annotation like: @WebServiceRef(wsdlLocation = "/WEB-INF/wsdl/TemplateService.wsdl") 'in' the Managed Bean directly seems to work OK; but appearantly not in a deeper layers...
...grumble..