[jboss-user] [JBoss Web Services] - Re: Bizzare host re-write in JAX-WS client on JB7.0.2
Alessio Soldano
do-not-reply at jboss.com
Thu Jun 7 11:23:08 EDT 2012
Alessio Soldano [https://community.jboss.org/people/asoldano] created the discussion
"Re: Bizzare host re-write in JAX-WS client on JB7.0.2"
To view the discussion, visit: https://community.jboss.org/message/740473#740473
--------------------------------------------------------------
I believe your use case might be a bit different from the JBWS-3260 one as you basically have the jaxws client running inside a jaxws endpoint business method. You are probably ending up using the server side bus that's started at deploy time for dealing with the endpoint. Just before each invocation of your endpoint business methods, the engine saves a references to the thread bus and then restores it when your business method is over. Your client should no be using the AddressRewritingEndpointInfo; that is installed by the SoapTransportFactoryExt, which is only added to the server side bus instances. One option you have to properly isolate your client environment (bus) from your server one is wrapping your client code into a try-finally block to set a different thread default bus isntance (for client only):
Bus mybus = BusFactory.newInstance().createBus();
...
try {
Bus orig = BusFactory.getThreadDefaultBus();
BusFactory.setThreadDefaultBus(mybus);
... client usage ...
} finally {
BusFactory.setThreadDefaultBus(orig);
... evaluate shutting down mybus or storing it somewhere if you don't want to rebuild it...
}
I'll check if there's a better solution for dealing this scenario.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/740473#740473]
Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120607/821701ac/attachment.html
More information about the jboss-user
mailing list