<!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="https://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 JB7.0.2
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/benze">Eric B</a> in <i>JBoss Web Services</i> - <a href="https://community.jboss.org/message/740458#740458">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span>I've run into a strange issue with JB7.0.2.FINAL with a JAX-WS client that is getting its destination address rewritten.&#160; The issue is not unsimilar to </span><a class="jive-link-external-small" href="https://community.jboss.org/thread/164507?tstart=0" target="_blank">https://community.jboss.org/thread/164507?tstart=0</a><span> or </span><a class="jive-link-external-small" href="https://issues.jboss.org/browse/JBWS-3260">https://issues.jboss.org/browse/JBWS-3260</a>.&#160; I don't know if this is a bug or rather if it is a configuration problem on my side.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I have created a JAX-WS WebService which encompases a client to communicate with another webservice.&#160; When my WS first calls the client, I see the following in my log file and the client connects without problems.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">
14:44:11,500 INFO&#160; [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (http--0.0.0.0-8080-1) Creating Service {http://www.mydom.ca/AgmtProdOpers/LoanAgreementMgmt/V1}LoanAgreementMgmtHttpService from WSDL: http://server1.npr.local/tu/LoanAgreementMgmt/V1?wsdl
14:44:15,377 INFO&#160; [org.jboss.wsf.stack.cxf.transport.AddressRewritingEndpointInfo] (http--0.0.0.0-8080-1) Setting new service endpoint address in wsdl: http://10.68.30.25:80/tu/LoanAgreementMgmt/V1
14:44:16,186 INFO&#160; [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (http--0.0.0.0-8080-1) Creating Service {http://www.mydom.ca/AgmtProdOpers/LoanAgreementMgmt/V1}LoanAgreementMgmtHttpService from WSDL: http://server1.npr.local/tu/LoanAgreementMgmt/V1?wsdl
14:44:16,195 INFO&#160; [org.jboss.wsf.stack.cxf.transport.AddressRewritingEndpointInfo] (http--0.0.0.0-8080-1) Setting new service endpoint address in wsdl: http://10.68.30.25:80/tu/LoanAgreementMgmt/V1
14:44:16,252 INFO&#160; [org.jboss.wsf.stack.cxf.transport.AddressRewritingEndpointInfo] (http--0.0.0.0-8080-1) Setting new service endpoint address in wsdl: http://localhost:8080/tu/LoanAgreementMgmt/V1
</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 style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>However, the second (and subsequent) times I call the same client, I get the following in my logs and the client fails to connect:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">
14:44:26,893 INFO&#160; [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (http--0.0.0.0-8080-1) Creating Service {http://www.mydom.ca/AgmtProdOpers/LoanAgreementMgmt/V1}LoanAgreementMgmtHttpService from WSDL: http://server1.npr.local/tu/LoanAgreementMgmt/V1?wsdl
14:44:26,903 INFO&#160; [org.jboss.wsf.stack.cxf.transport.AddressRewritingEndpointInfo] (http--0.0.0.0-8080-1) Setting new service endpoint address in wsdl: http://localhost:8080/tu/LoanAgreementMgmt/V1
14:44:27,570 INFO&#160; [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (http--0.0.0.0-8080-1) Creating Service {http://www.mydom.ca/AgmtProdOpers/LoanAgreementMgmt/V1}LoanAgreementMgmtHttpService from WSDL: http://server1.npr.local/tu/LoanAgreementMgmt/V1?wsdl
14:44:27,579 INFO&#160; [org.jboss.wsf.stack.cxf.transport.AddressRewritingEndpointInfo] (http--0.0.0.0-8080-1) Setting new service endpoint address in wsdl: http://localhost:8080/tu/LoanAgreementMgmt/V1
14:44:27,625 INFO&#160; [org.jboss.wsf.stack.cxf.transport.AddressRewritingEndpointInfo] (http--0.0.0.0-8080-1) Setting new service endpoint address in wsdl: http://localhost:8080/tu/LoanAgreementMgmt/V1
...
...
...
Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '404: Not Found' when communicating with http://localhost:8080/tu/LoanAgreementMgmt/V1
&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1554)
&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1493)
&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1401)
&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:648)

</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>This time around, the client tries to connect to localhost:8080 which is obviously not the correct address/port for the destination service.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>If I edit the standalone-preview.xml file and change the default setting</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;subsystem xmlns="urn:jboss:domain:webservices:1.0" xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:jaxwsconfig="urn:jboss:jbossws-jaxws-config:4.0"&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;wsdl-host&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; localhost
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/wsdl-host&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;modify-wsdl-address&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; true
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/modify-wsdl-address&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>to</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;subsystem xmlns="urn:jboss:domain:webservices:1.0" xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:jaxwsconfig="urn:jboss:jbossws-jaxws-config:4.0"&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;wsdl-host&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; localhost&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/wsdl-host&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;modify-wsdl-address&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; false&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/modify-wsdl-address&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>then everything works as expected.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">
15:39:45,129 INFO&#160; [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (http-0.0.0.0-0.0.0.0-8080-1) Creating Service {http://www.mydom.ca/AgmtProdOpers/LoanAgreementMgmt/V1}LoanAgreementMgmtHttpService from WSDL: http://server1.npr.local/tu/LoanAgreementMgmt/V1?wsdl
15:39:45,139 INFO&#160; [org.jboss.wsf.stack.cxf.transport.AddressRewritingEndpointInfo] (http-0.0.0.0-0.0.0.0-8080-1) Setting new service endpoint address in wsdl: http://10.68.30.25:80/tu/LoanAgreementMgmt/V1
15:39:45,627 INFO&#160; [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (http-0.0.0.0-0.0.0.0-8080-1) Creating Service {http://www.mydom.ca/AgmtProdOpers/LoanAgreementMgmt/V1}LoanAgreementMgmtHttpService from WSDL: http://server1.npr.local/tu/LoanAgreementMgmt/V1?wsdl
15:39:45,637 INFO&#160; [org.jboss.wsf.stack.cxf.transport.AddressRewritingEndpointInfo] (http-0.0.0.0-0.0.0.0-8080-1) Setting new service endpoint address in wsdl: http://10.68.30.25:80/tu/LoanAgreementMgmt/V1
</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 style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Is this a configuration issue on my side, or is this still a trailing bug from the CXF stack (see above jira link)?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks,</p><p><br/>Eric</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/740458#740458">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services at <a href="https://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>