6 Replies Latest reply on May 12, 2006 9:21 AM by thomas.diesler

    Generating WSDL on the fly in JBoss-WS

    pdog4x4

      Hey guys!

      Let me start by saying I'm liking JBoss a lot. Anyhow, I've tried several times to get my WSDL to generate properly. I've followed the tutorial on the WIKI, everything gets deployed nicely and my client even works.

      One of the requirements is on the fly WSDL for our clients who will connecting to the service.

      However, the problem is that when I append a "?wsdl" to the end of the service, I get a blank page and no WSDL! For the time being, I've just made the WSDL available as a link generated by wscompile, but of course using hard coded ones as I have been forced to do will not suffice long term.

      I have looked at all the logs I am aware of and have not located the problem. I've also attempted to install AXIS as a WAR and implement it that way after googling for about two days. Neither solution produced the WSDL. The part that is driving me nuts is that I got AXIS working with TOMCAT properly.

      Any ideas?

      Thanks!

      Joshua Preston.

        • 1. Re: Generating WSDL on the fly in JBoss-WS
          pdog4x4

           


          I have looked at all the logs I am aware of and have not located the problem. I've also attempted to install AXIS as a WAR and implement it that way after googling for about two days. Neither solution produced the WSDL. The part that is driving me nuts is that I got AXIS working with TOMCAT properly.


          Ok, so apparently I messed my classlibs up pretty good. Got them fixed and my WSDL is being properly generated. I do have another problem however... The WSDL that is generated will not work for remote endpoints... It is generating the Port info with the hostname, not FQDN which makes it impossible just to create a quick client based on the WSDL.

          The generated parts look like:
          ...
           <service name="FortuneService">
           <port binding="tns:FortuneBinding" name="FortunePort">
           <soap:address location="http://aku:8080/Fortune/Fortune"/>
           </port>
           </service>
          ...
          

          And should look like:
          ...
           <service name="FortuneService">
           <port binding="tns:FortuneBinding" name="FortunePort">
           <soap:address location="http://www.prestoncentral.com/Fortune/Fortune"/>
           </port>
           </service>
          ...
          


          How can I specify or force the use of the a different hostname and port? I'm using this under Apache, with the JK connector, which is working properly.

          Thanks!

          Joshua Preston.

          • 2. Re: Generating WSDL on the fly in JBoss-WS
            thomas.diesler

            Have a look at

             <!--
             The WSDL that is a required deployment artifact for an endpoint has a <soap:address>
             element which points to the location of the endpoint. JBoss supports rewriting of that soap address.
            
             If the content of <soap:address> is a valid URL, JBoss will not rewrite it unless AlwaysModifySOAPAddress=true
             If the content of <soap:address> is not a valid URL, JBoss will rewrite it using the attribute values given below.
             -->
             <attribute name="WebServiceHost">${jboss.bind.address}</attribute>
             <attribute name="WebServiceSecurePort">8443</attribute>
             <attribute name="WebServicePort">8080</attribute>
             <attribute name="AlwaysModifySOAPAddress">true</attribute>
            


            in

            server\default\deploy\jboss-ws4ee.sar\META-INF\jboss-service.xml

            • 3. Re: Generating WSDL on the fly in JBoss-WS
              pdog4x4

              Thomas,

              Thanks a million, there are times when I smack my head over and over, this being one of them!

              Thanks!

              Joshua Preston

              • 4. Re: Generating WSDL on the fly in JBoss-WS
                danjourno

                Hi pdog,

                Can you tell me which tutorial you used?

                Thanks
                Dan

                • 5. Re: Generating WSDL on the fly in JBoss-WS
                  symmetrysolutions

                  Thomas,

                  The JSR-181 implemenation seems to re-write the soap:address to the settings in the jboss-service.xml that is buried in the jbossws.sar file. It would be nice if I did not have to modify this file to avoid the address from always returning 8080. Maybe the port can also be a dynamic parameter like the host name?

                  Is there any other place to change the port without opening the sar file?

                  Thanks for your help.

                  • 6. Re: Generating WSDL on the fly in JBoss-WS
                    thomas.diesler

                     

                     ${jboss.bind.address}
                    


                    is a system property. This kind of replacement works for all properties in all descriptors. You can externalize the port in a simmilar way