<!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;"> </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;"> </p><p>but the end of<strong> wsdl always show the following lines:</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><wsdl:service name="WSMashupService"> </p><p> <wsdl:port name="WSMashupServicePort" binding="tns:WSMashupServiceSoapBinding"> </p><p>  <soap:address location="<a class="jive-link-external-small" href="http://localhost:8080/webservices/ExampleService&quot;/">http://localhost:8080/webservices/ExampleService"/</a>> </p><p> </wsdl:port> </p><p></wsdl:service></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p> my client side code always try to connect to port 8080   after parsing wsdl . </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>client side code is like following :</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>   Authenticator.setDefault(new Authenticator() {<br/>    protected PasswordAuthentication getPasswordAuthentication() {<br/>     return new PasswordAuthentication("testuser", "testpass"<br/>       .toCharArray());<br/>    }<br/>   });<br/>   URL wsdlURL = new URL(<br/>     "<a class="jive-link-external-small" href="https://localhost:8444/webservices/ExampleService?wsdl">https://localhost:8444/webservices/ExampleService?wsdl</a>");</p><p>   QName qname = new QName("<a class="jive-link-external-small" href="http://test.com/webservices">http://test.com/webservices</a>",<br/>     "WSMashupService");<br/>   Service service = Service.create(wsdlURL, qname);<br/>   WSMashupInterface port = service.getPort(WSMashupInterface.class);<br/>   BindingProvider bp = (BindingProvider) port;<br/>   bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY,<br/>     "testuser");<br/>   bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,<br/>     "testpass");<br/>   port.dosomethingMashup("12121212121212"); <strong>---------------------------------this line  always throw exception :</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </p><p><strong>the server config is :</strong></p><p>...</p><p>        <subsystem xmlns="urn:jboss:domain:web:1.1" native="false" default-virtual-server="default-host"></p><p>            <connector name="http" protocol="HTTP/1.1" scheme="https" socket-binding="https" secure="true"></p><p>                <ssl key-alias="serverCert" password="servercert" certificate-key-file="${jboss.server.config.dir}/jboss.keystore"/></p><p>            </connector></p><p>            <virtual-server name="default-host" enable-welcome-root="true"></p><p>                <alias name="localhost"/></p><p>                <alias name="example.com"/></p><p>            </virtual-server></p><p>        </subsystem></p><p>...</p><p>        <subsystem xmlns="urn:jboss:domain:webservices:1.1"></p><p>            <modify-wsdl-address>true</modify-wsdl-address></p><p>            <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host></p><p>            <wsdl-secure-port>8444</wsdl-secure-port></p><p>            <endpoint-config name="Standard-Endpoint-Config"/></p><p>            <endpoint-config name="Recording-Endpoint-Config"></p><p>                <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM"></p><p>                    <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/></p><p>                </pre-handler-chain></p><p>            </endpoint-config></p><p>        </subsystem></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>the server side code is :</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>the interface code :</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </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>