3 Replies Latest reply on Oct 13, 2012 5:58 PM by Tomaz Cerar

    Possible to have different wsdl's (webservice endpoints) use different ports on jboss 7?

    David Pugh Newbie

      Hello, I have a dilly of a pickle and need some help.

      We have 2 apache cxf webservice endpoints, each as their own war and each with a seperate wsdl.

      One of these need to be publicly available and one of the endpoints needs to be accessible from our companies internal networks only.

       

      Is it possible to make the webservice endpoint (the one that needs to be accessible from our internal networks only) on a different port than the webservice endpoint that needs to be publicly available?

       

      If we could do this then we could set firewall restrictions on the port that is used for the webservice endpoint (that needs to be accessible from our internal networks only) and make sure that the only calls that are allowed on that

      server on that port come from our internal networks.

       

      As of right now they would all be accessible from the same server address on the same port.  Is there a way to configure access to the 2 wsdl's to have seperate ports?

       

      Please help me.

       

      David

        • 1. Re: Possible to have different wsdl's (webservice endpoints) use different ports on jboss 7?
          Stephen Coy Master

          Have a look at AS71 Web subsystem configuration, where you should be able to work out how to setup different connectors and associate them with your application.

          • 3. Re: Possible to have different wsdl's (webservice endpoints) use different ports on jboss 7?
            Tomaz Cerar Master

            Richard,

             

            I think it could be done with few changes to configuration. (note that this is not tested but it should work)

            this are changes to web subsystem

             

            ...
            <connector name="http-vs1" scheme="http" protocol="HTTP/1.1" socket-binding="http-1" >
                <virtual-server name="vs1" />
            </connector>
            <connector name="http-vs2" scheme="http" protocol="HTTP/1.1" socket-binding="http-2" >
                <virtual-server name="vs2" />
            </connector>
            <virtual-server name="vs1" >
             <alias name="vs1.alias.something" />
             ...
            </virtual-server>
            <virtual-server name="vs2" >
             <alias name="vs2.alias.something" />
             ...
            </virtual-server>
            ...
            

            In short, we create two connectors(you could reuse default one) and create two virutal hosts.

            Please note that child element virtual-server of connector is there just to limit what virutal servers can connector server, if you omit that it will serve all of them, bit of alert here, this is broken in 7.1.1 so you would need to get 7.2 nightly build or build yourself 7.1 branch. But for proof of concept you can just remove this line and it will stil work

             

            The next thing you need to do is add extra annotation to your web service,

            @org.jboss.ws.api.annotation.@WebContext(virtualHost = "vs1")
            

             

            that will bind your web service to vs1 virtual host.

            and just add same annotation on other web service with binding to vs2.

             

            so then when you will go to port of http1 you will get web service binded to vs1 and http2 the one binded on vs2

             

            that you can find by this maven coordinates:

            <dependency>
                <groupId>org.jboss.ws</groupId>
                <artifactId>jbossws-api</artifactId>
                <version>1.0.0.GA</version>
                <scope>provided</scope>
            </dependency>
            

             

            it is some work, but it *should* work.

             

            --

            tomaz