[jboss-user] [JBoss Web Services] - newbie question about soap address

Joseph Wu do-not-reply at jboss.com
Thu Mar 22 04:33:10 EDT 2012


Joseph Wu [https://community.jboss.org/people/wutongjoe] created the discussion

"newbie question about soap address"

To view the discussion, visit: https://community.jboss.org/message/725506#725506

--------------------------------------------------------------
Hi all,

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:
 https://localhost:8444/webservices/ExampleService?wsdl https://localhost:8444/webservices/ExampleService?wsdl 

but the end of *wsdl always show the following lines:*

<wsdl:service name="WSMashupService"> 
 <wsdl:port name="WSMashupServicePort" binding="tns:WSMashupServiceSoapBinding"> 
  <soap:address location=" http://localhost:8080/webservices/ExampleService&quot;/ http://localhost:8080/webservices/ExampleService"/> 
 </wsdl:port> 
</wsdl:service>


 my client side code always try to connect to port 8080   after parsing wsdl . 

*client side code is like following :*

   Authenticator.setDefault(new Authenticator() {
    protected PasswordAuthentication getPasswordAuthentication() {
     return new PasswordAuthentication("testuser", "testpass"
       .toCharArray());
    }
   });
   URL wsdlURL = new URL(
     " https://localhost:8444/webservices/ExampleService?wsdl https://localhost:8444/webservices/ExampleService?wsdl");
   QName qname = new QName(" http://test.com/webservices http://test.com/webservices",
     "WSMashupService");
   Service service = Service.create(wsdlURL, qname);
   WSMashupInterface port = service.getPort(WSMashupInterface.class);
   BindingProvider bp = (BindingProvider) port;
   bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY,
     "testuser");
   bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY,
     "testpass");
   port.dosomethingMashup("12121212121212"); *---------------------------------this line  always throw exception :*

Caused by: java.net.ConnectException: Connection refused: connect
 at java.net.PlainSocketImpl.socketConnect(Native Method)
 at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
 at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)

*the server config is :*
...
        <subsystem xmlns="urn:jboss:domain:web:1.1" native="false" default-virtual-server="default-host">
            <connector name="http" protocol="HTTP/1.1" scheme="https" socket-binding="https" secure="true">
                <ssl key-alias="serverCert" password="servercert" certificate-key-file="${jboss.server.config.dir}/jboss.keystore"/>
            </connector>
            <virtual-server name="default-host" enable-welcome-root="true">
                <alias name="localhost"/>
                <alias name="example.com"/>
            </virtual-server>
        </subsystem>
...
        <subsystem xmlns="urn:jboss:domain:webservices:1.1">
            <modify-wsdl-address>true</modify-wsdl-address>
            <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
            <wsdl-secure-port>8444</wsdl-secure-port>
            <endpoint-config name="Standard-Endpoint-Config"/>
            <endpoint-config name="Recording-Endpoint-Config">
                <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
                    <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
                </pre-handler-chain>
            </endpoint-config>
        </subsystem>

*the server side code is :*

@Stateless
@Clustered
@WebContext( contextRoot = "/webservices" , urlPattern="/ExampleService",authMethod="BASIC", transportGuarantee="NONE", secureWSDLAccess=true)
@WebService(name="WSMashupService",serviceName = "WSMashupService", targetNamespace = " http://test.com/webservices http://test.com/webservices")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@SecurityDomain(value = "my-security-domain")
@RolesAllowed(value = { "testrole" })
public class WSMashupImpl implements WSMashupInterface {


*the interface code :*

@WebService(name="WSMashupService",serviceName = "WSMashupService", targetNamespace = " http://test.com/webservices http://test.com/webservices")
@WebContext( contextRoot = "/webservices" , urlPattern="/ExampleService",authMethod="BASIC", transportGuarantee="NONE", secureWSDLAccess=true)
public interface WSMashupInterface {



I think the problem is with soap address rewrite.Am I right ? what is wrong with my code and config ? 

Thanks a lot
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/725506#725506]

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/20120322/f13cab9a/attachment.html 


More information about the jboss-user mailing list