<!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;">
    newbie question about soap address
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/wutongjoe">Joseph Wu</a> in <i>JBoss Web Services</i> - <a href="https://community.jboss.org/message/725506#725506">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 all,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I was developing an EJB based webservice .I have configed JBAS 7.1 to use https .I can browse wsdl and view xml using browser with following address:</p><p><a class="jive-link-external-small" href="https://localhost:8444/webservices/ExampleService?wsdl">https://localhost:8444/webservices/ExampleService?wsdl</a> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>but the end of<strong> wsdl always show the following lines:</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;wsdl:service name="WSMashupService"&gt; </p><p> &lt;wsdl:port name="WSMashupServicePort" binding="tns:WSMashupServiceSoapBinding"&gt; </p><p>&#160; &lt;soap:address location="<a class="jive-link-external-small" href="http://localhost:8080/webservices/ExampleService&amp;quot;/">http://localhost:8080/webservices/ExampleService"/</a>&gt; </p><p> &lt;/wsdl:port&gt; </p><p>&lt;/wsdl:service&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p> my client side code always try to connect to port 8080&#160;&#160; after parsing wsdl . </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>client side code is like following :</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160; Authenticator.setDefault(new Authenticator() {<br/>&#160;&#160;&#160; protected PasswordAuthentication getPasswordAuthentication() {<br/>&#160;&#160;&#160;&#160; return new PasswordAuthentication("testuser", "testpass"<br/>&#160;&#160;&#160;&#160;&#160;&#160; .toCharArray());<br/>&#160;&#160;&#160; }<br/>&#160;&#160; });<br/>&#160;&#160; URL wsdlURL = new URL(<br/>&#160;&#160;&#160;&#160; "<a class="jive-link-external-small" href="https://localhost:8444/webservices/ExampleService?wsdl">https://localhost:8444/webservices/ExampleService?wsdl</a>");</p><p>&#160;&#160; QName qname = new QName("<a class="jive-link-external-small" href="http://test.com/webservices">http://test.com/webservices</a>",<br/>&#160;&#160;&#160;&#160; "WSMashupService");<br/>&#160;&#160; Service service = Service.create(wsdlURL, qname);<br/>&#160;&#160; WSMashupInterface port = service.getPort(WSMashupInterface.class);<br/>&#160;&#160; BindingProvider bp = (BindingProvider) port;<br/>&#160;&#160; bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY,<br/>&#160;&#160;&#160;&#160; "testuser");<br/>&#160;&#160; bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,<br/>&#160;&#160;&#160;&#160; "testpass");<br/>&#160;&#160; port.dosomethingMashup("12121212121212"); <strong>---------------------------------this line&#160; always throw exception :</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Caused by: java.net.ConnectException: Connection refused: connect</p><p> at java.net.PlainSocketImpl.socketConnect(Native Method)</p><p> at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)</p><p> at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>the server config is :</strong></p><p>...</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;subsystem xmlns="urn:jboss:domain:web:1.1" native="false" default-virtual-server="default-host"&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;connector name="http" protocol="HTTP/1.1" scheme="https" socket-binding="https" secure="true"&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ssl key-alias="serverCert" password="servercert" certificate-key-file="${jboss.server.config.dir}/jboss.keystore"/&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/connector&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;virtual-server name="default-host" enable-welcome-root="true"&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;alias name="localhost"/&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;alias name="example.com"/&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/virtual-server&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/subsystem&gt;</p><p>...</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;subsystem xmlns="urn:jboss:domain:webservices:1.1"&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;modify-wsdl-address&gt;true&lt;/modify-wsdl-address&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;wsdl-host&gt;${jboss.bind.address:127.0.0.1}&lt;/wsdl-host&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;wsdl-secure-port&gt;8444&lt;/wsdl-secure-port&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;endpoint-config name="Standard-Endpoint-Config"/&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;endpoint-config name="Recording-Endpoint-Config"&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM"&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/pre-handler-chain&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/endpoint-config&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/subsystem&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>the server side code is :</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>@Stateless</p><p>@Clustered</p><p>@WebContext( contextRoot = "/webservices" , urlPattern="/ExampleService",authMethod="BASIC", transportGuarantee="NONE", secureWSDLAccess=true)</p><p>@WebService(name="WSMashupService",serviceName = "WSMashupService", targetNamespace = "<a class="jive-link-external-small" href="http://test.com/webservices">http://test.com/webservices</a>")</p><p>@SOAPBinding(style = SOAPBinding.Style.RPC)</p><p>@SecurityDomain(value = "my-security-domain")</p><p>@RolesAllowed(value = { "testrole" })</p><p>public class WSMashupImpl implements WSMashupInterface {</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>the interface code :</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>@WebService(name="WSMashupService",serviceName = "WSMashupService", targetNamespace = "<a class="jive-link-external-small" href="http://test.com/webservices">http://test.com/webservices</a>")</p><p>@WebContext( contextRoot = "/webservices" , urlPattern="/ExampleService",authMethod="BASIC", transportGuarantee="NONE", secureWSDLAccess=true)</p><p>public interface WSMashupInterface {</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>I think the problem is with soap address rewrite.Am I right ? what is wrong with my code and config ? </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks a lot</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/725506#725506">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>