Dear CXF community,
We are using CXF jax-ws to develop a system. There is a jax-ws service as the
"wrapper" service, it requires to refer itsself as the webservice client in its
SEI.
The steps to generate the service are:
1) create a SEI, something like
@WebService
public class WSDLRefSelf {
public String echo(String arg) {
return name;
}
}
2) deploy it with CXF, then we get its WSDL file
3) use the WSDL file to generate its client stub
4) update the SEI, something like
@WebService
public class WSDLRefSelf {
@WebServiceRef
private WSDLRefSelfService client;
public String echo(String arg) {
String name=client.getServiceName().getLocalPart();
return name;
}
}
Then the issue occurs, the init of the service endpoint will fail due to fail
to inject or get the client object.
With debugging on CXF code, it seems the root cause is when init the service
endpoint instance, the inject objects should be init. However, the client
requires the service WSDL to init, the target serivce is still on init process.
We find one workaround is to generate the WSDL first, and modify the client
stub's WSDL location, it works. Unfortunately, we don't want to use the
workaround as our system will generate the SEI dynamcally while we don't want
to do one more step to generate WSDL first.
We wish the community can give a hand, see if it is a bug or any other method
to achieve that.
Thanks!