<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Bizzare host re-write in JAX-WS client on JB6
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/borfnorton22">borfnorton22 borfnorton22</a> in <i>JBoss Web Services</i> - <a href="http://community.jboss.org/message/595634#595634">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>We recent upgraded from Jboss 4.22 to Jboss 6.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The code I am describing below works fine on 4.2.2.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>a) We have a JAX-WS generated client</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>b) The generated client code is configured to talk to a remote webservice and it calls a method on it as follows.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java">URL url = <font color="navy"><b>new</b></font> URL(<font color="red">"http://bass01.stage.fishing89k41.com:80/Netter/NetterSyncQ.nsf/NetterWS?OpenWebService?WSDL"</font>);
NetterService netterService = <font color="navy"><b>new</b></font> NetterService(url);
netterService.getNetterServicePort().isNetAvailable(<font color="red">"someNetName"</font>);
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The remote web-services WSDL exposes its service endpoint address as follows:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">&lt;service name="NetterService"&gt;
&lt;port binding="impl:NetterServicePortSoapBinding" name="NetterServicePort"&gt;
&lt;wsdlsoap:address location="http://bass01.stage.fishing89k41.com:80/Netter/NetterSyncQ.nsf/NetterWS?OpenWebService"/&gt;
&lt;/port&gt;
&lt;/service&gt;</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>c) When this is running on Jboss 4.2.2 it works fine and has for quite some time. When the code executes on our JB6 server we see this is the logs which is absolutely bizzarre! <span style="font-size: 12pt;"><strong>Something in JB6 (cxf AddressRewritingEndpointInfo) is re-writing the hostname portion of the endpoint out client needs to talk to to a different host. </strong></span>This totally fails as when it trys to make a call we get a 404. Help! as we are sort of screwed. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">11:02:38,377 INFO&#160; [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] Creating Service {urn:DefaultNamespace}NetterService from WSDL: http://bass01.stage.fishing89k41.com:80/Netter/NetterSyncQ.nsf/NetterWS?OpenWebService?WSDL

11:02:38,378 INFO&#160; [org.jboss.wsf.stack.cxf.transport.AddressRewritingEndpointInfo] Setting new service endpoint address in wsdl: http://ws-stage.fishing89k41.com/Netter/NetterSyncQ.nsf/NetterWS&#160;&#160; 

11:02:38,394 INFO&#160; [org.jboss.wsf.stack.cxf.transport.AddressRewritingEndpointInfo] Setting new service endpoint address in wsdl: http://ws-stage.fishing89k41.com/Netter/NetterSyncQ.nsf/NetterWS&#160;&#160; 

11:02:38,406 WARN&#160; [org.apache.cxf.phase.PhaseInterceptorChain] Interceptor for {urn:DefaultNamespace}NetterService#{urn:DefaultNamespace}isNetAvailable has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault: Could not send Message.
&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64) [:2.3.1]
&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516) [:2.3.1]
&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313) [:2.3.1]
&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265) [:2.3.1]
&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) [:2.3.1]
&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) [:2.3.1]
&#160;&#160;&#160;&#160;&#160;&#160;&#160; at $Proxy302.isNetAvailable(Unknown Source)&#160;&#160; at some.service.SomeService.
</code></pre></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/595634#595634">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>