1 2 Previous Next 17 Replies Latest reply on Mar 15, 2006 1:02 PM by catfishtyphoon

    making a redeployable .war or .ear

    chriscorbell

      I'm working on a web-service application that is meant to be configurable at deploy-time for any host machine - i.e., we don't know the WSDL port of the target host machine at build time.

      What standard ways are there to set the WSDL port at deploy-time rather than at build time?

      The only solution I have so far is to leave a mock value in the WSDL and replace it with a deployment tool that actually modifies the WSDL file during install of the service.

      However if there's a more standard way to do this with an external properties file - whether or not it's a JBoss-specific technique - I'd be grateful to know about it.

      TIA,
      Chris

        • 1. Re: making a redeployable .war or .ear
          starksm64

          Most of our descriptor parsing allows for system property references of the form ${x} where x is a system property that is replace when the deployment is processed. I don't know if this support has been added to the web services deployer, but its something we should support if possible.

          • 2. Re: making a redeployable .war or .ear
            thomas.diesler

            The host and port references are automatically generated for a server side WS deployment.

            A client deployment needs to have the correct WSDL location specified it is pointing to. Are you talking about a WS client deployment?

            • 3. Re: making a redeployable .war or .ear
              chriscorbell

              Thanks, I am talking about server side deployment...

              Does this mean that I can just omit the port element from my WSDL, and JBoss will generate it appropriately for my service?

              - Chris

              • 4. Re: making a redeployable .war or .ear
                thomas.diesler
                • 5. Re: making a redeployable .war or .ear
                  chriscorbell

                  Thanks Thomas!

                  • 6. Re: making a redeployable .war or .ear
                    simpletron

                    Can you tell JBoss (4.0.1) to override the default behaviour of inserting the deploying server's hostname and port in the <soap:address location> of the wsdl?

                    My home network is behind a router/firewall which forwards traffic on port 80/8080 to the server running JBoss. I would like to test my web service from outside this network, but currently external clients reading the wsdl are given an address location that is only relevant to clients on my home network.

                    I have a dyndns domain name (ie something like xxxxx.homeip.net) that I would like to use as the address location of the webservice within the wsdl. Other than attempting to update the wsdl after deploying the .ear, the only other solution I've managed is to make a copy of the wsdl, update it with the desired address location url, host it elsewhere on my webserver and then point clients at that instead of the deployed wsdl. This works but does not seem very elegant.

                    Thank you in advance.

                    • 7. Re: making a redeployable .war or .ear
                      thomas.diesler

                      Change WebServiceHost in ${jboss.server.deploy.dir}/jboss-ws4ee.sar/META-INF/jboss-service.xml

                       <mbean code="org.jboss.webservice.AxisService"
                       name="jboss.ws4ee:service=AxisService">
                       <depends>jboss:service=WebService</depends>
                       <attribute name="WebServiceHost">${jboss.bind.address}</attribute>
                       <attribute name="WebServiceSecurePort">8443</attribute>
                       <attribute name="WebServicePort">8080</attribute>
                       <attribute name="InvokerProviderEJB">org.jboss.webservice.server.InvokerProviderEJB</attribute>
                       <attribute name="InvokerProviderJSE">org.jboss.webservice.server.InvokerProviderJSE</attribute>
                       </mbean>
                      


                      • 8. Re: making a redeployable .war or .ear
                        simpletron

                        Thanks Thomas that worked fine.

                        • 9. Re: making a redeployable .war or .ear
                          darickard

                           

                          "thomas.diesler@jboss.com" wrote:
                          Change WebServiceHost in ${jboss.server.deploy.dir}/jboss-ws4ee.sar/META-INF/jboss-service.xml

                           <mbean code="org.jboss.webservice.AxisService"
                           name="jboss.ws4ee:service=AxisService">
                           <depends>jboss:service=WebService</depends>
                           <attribute name="WebServiceHost">${jboss.bind.address}</attribute>
                           <attribute name="WebServiceSecurePort">8443</attribute>
                           <attribute name="WebServicePort">8080</attribute>
                           <attribute name="InvokerProviderEJB">org.jboss.webservice.server.InvokerProviderEJB</attribute>
                           <attribute name="InvokerProviderJSE">org.jboss.webservice.server.InvokerProviderJSE</attribute>
                           </mbean>
                          


                          When I did this JBoss deploys only to the WebServicePort. How do I get JBoss to deploy to the WebServiceSecurePort?

                          • 10. Re: making a redeployable .war or .ear
                            thomas.diesler

                            You don't deploy a webapp to a specific port, you deploy it to tomcat. If the service endpoint address in the wsdl starts with 'https://' then we use the 'WebServiceSecurePort' to rewrite the address

                            • 11. Re: making a redeployable .war or .ear
                              darickard

                               

                              "thomas.diesler@jboss.com" wrote:
                              You don't deploy a webapp to a specific port, you deploy it to tomcat. If the service endpoint address in the wsdl starts with 'https://' then we use the 'WebServiceSecurePort' to rewrite the address


                              Thanks for the quick reply. What I should have said is, I can get JBoss to put a service endpoint address of 'http://myhost...' in the WSDL by making the modifications you suggested, but I'd like the URL in the WSDL to be 'https://myhost...' instead. I've got Tomcat setup with SSL, etc., I just need JBoss to publish that URL in the WSDL.

                              • 12. Re: making a redeployable .war or .ear
                                thomas.diesler

                                What happens when you put

                                https://SOME_URL_TO_BE_REPLACED_BY_JBOSS
                                


                                in the wsdl?

                                • 13. Re: making a redeployable .war or .ear
                                  darickard

                                   

                                  "thomas.diesler@jboss.com" wrote:
                                  What happens when you put

                                  
                                  https://SOME_URL_TO_BE_REPLACED_BY_JBOSS
                                  


                                  in the wsdl?


                                  I changed the AlwaysModifySOAPAddress attribute to false in jboss-service.xml, added my https url to the wsdl, and redeployed, then got the following exception. I double checked that the URL I put in the WSDL was valid. According to the comment in jboss-service.xml, it seems it should not be trying to rewrite it.
                                  If the content of <soap:address> is a valid URL, JBoss will not rewrite it unless AlwaysModifySOAPAddress=true

                                  I can't provide the exact URL, but it looks like this:
                                  https://subdomain.domain.com/AppCategory/AppName

                                  2005-06-20 15:33:46,076 ERROR [org.jboss.webservice.ServiceDeployer] Cannot startup webservice for: TrafficCitationUpdate1.war
                                  java.lang.NoClassDefFoundError: javax/wsdl/Definition
                                   at org.jboss.webservice.metadata.WebserviceDescriptionMetaData.replaceAddressLocations(WebserviceDescriptionMetaData.java:277)
                                   at org.jboss.webservice.metadata.WebserviceDescriptionMetaData.updateServiceAddress(WebserviceDescriptionMetaData.java:253)
                                   at org.jboss.webservice.ServiceDeployer.startWebservice(ServiceDeployer.java:211)
                                   at org.jboss.webservice.ServiceDeployer.handleNotification(ServiceDeployer.java:112)
                                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                   at java.lang.reflect.Method.invoke(Method.java:585)
                                   at org.jboss.mx.notification.NotificationListenerProxy.invoke(NotificationListenerProxy.java:138)
                                   at $Proxy54.handleNotification(Unknown Source)
                                   at org.jboss.mx.util.JBossNotificationBroadcasterSupport.handleNotification(JBossNotificationBroadcasterSupport.java:112)
                                   at org.jboss.mx.util.JBossNotificationBroadcasterSupport.sendNotification(JBossNotificationBroadcasterSupport.java:95)
                                   at org.jboss.deployment.SubDeployerSupport.emitNotification(SubDeployerSupport.java:238)
                                   at org.jboss.deployment.SubDeployerSupport.start(SubDeployerSupport.java:206)
                                   at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:410)
                                   at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
                                   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
                                   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
                                   at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source)
                                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                   at java.lang.reflect.Method.invoke(Method.java:585)
                                   at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
                                   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
                                   at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
                                   at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                                   at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
                                   at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
                                   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
                                   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
                                   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
                                   at $Proxy8.deploy(Unknown Source)
                                   at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:325)
                                   at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:483)
                                   at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
                                   at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:215)
                                   at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:194)
                                  


                                  • 14. Re: making a redeployable .war or .ear
                                    anil.saldhana

                                    You are missing wsdl4j.jar that has javax/wsdl/definition.

                                    1 2 Previous Next