6 Replies Latest reply on Mar 23, 2007 10:05 AM by David Owens

    Enforcing a WSDL without doing WSDL first development (top t

    David Win Newbie

      Hey guys

      Some aspects of the WSDL can be enforced via annotations such as webParam and @WebService but some things cannot be enforced via annotations such as adding non-nillable arguments to specific web parameters.

      Is it possible to modify the generated WSDL (at runtime) and use @WebService (wsdlLocation="xxx/xxx.wsdl) as long as the java code and WSDL do not contradict each other?

      I guess what would be helpful is to know if JBossWS checks (compiles) WSDL against the Java class at runtime or if JBossWS generates a WSDL every time when an wsimport is not done?

      thanks for any information

        • 1. Re: Enforcing a WSDL without doing WSDL first development (t
          David Win Newbie

          Also,

          this maybe a very trivial question to some but I am kinda lost

          Is there a place in an ejb jar or ear to store the WSDL file so that the annotation @Webservice(wsdlLocation="") such that I can place it so that it doesn't need an absolute URL.

          For example, if I could make a folder called wsdl in the ear or jar file so that the ejb with @WebService(wsdlLocation="myWsdl.wsdl").

          wsdLocation="http://myurl../myApp/" works but I want to make it so that the ejb finds the wsdl without knowing the full url. Is this possible?

          thanks

          • 2. Re: Enforcing a WSDL without doing WSDL first development (t
            David Win Newbie

            Ok, just found a way...

            you put the wsdl in the META-INF folder which is the root,
            so if you have a file META-INF/wsdl/myWSDL.wsdl

            your annotation would look like such
            @WebService (wsdlLocation='META-INF/wsdl/myWSDL.wsdl")

            However, it seems that the changes I made to META-INF/wsdl/myWSDL.wsdl do not make it to the http://myurl.../myapp?wsdl.

            Thus, the wsdlLocation the actual wsdl document that is used by JBossWS. It appears that the WSDL is generated (at runtime) regardless of whether wsdlLocation is present or not.

            can the JBoss guys clarify this for me? Basically, wsdlLocation is the not the wsdl used, that the WSDL is generated regardless of whether wsdlLocation is there or not.

            • 3. Re: Enforcing a WSDL without doing WSDL first development (t
              David Win Newbie

              Ok, correction...some ant scripts did not deploy right.

              enforcing the WSDL through wsdlLocation does work and it is used.

              You just have to ensure that the wsdl in wsdl location does not contradict the web service implementation.

              So if you want to add comments using xs:documentation, you can do so or want to use nillable=false (which by default if attribute it not present).

              I must say...web service development has never been easier!

              • 4. Re: Enforcing a WSDL without doing WSDL first development (t
                Thomas Diesler Master

                The wsdl you declare in wsdlLocation is simply published by the endpoint. Import URLs and endpoint address are rewritten otherwise there is little no none validation against the annotations that the endpoint uses. The internal meta data model is always build from the annotations.

                • 5. Re: Enforcing a WSDL without doing WSDL first development (t
                  David Owens Newbie

                   

                  "dwin" wrote:
                  Ok, correction...some ant scripts did not deploy right.

                  enforcing the WSDL through wsdlLocation does work and it is used.

                  You just have to ensure that the wsdl in wsdl location does not contradict the web service implementation.

                  So if you want to add comments using xs:documentation, you can do so or want to use nillable=false (which by default if attribute it not present).

                  I must say...web service development has never been easier!


                  So what exactly did you do to get it to work?
                  Where is the myWSDL.wsdl file located in the war file and what does the @WebService(wsdlLocation="...") say exactly?

                  Thanks for you help!

                  • 6. Re: Enforcing a WSDL without doing WSDL first development (t
                    David Owens Newbie

                    Okay, never mind, I figured it out.

                    http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031052

                    I did a few things wrong:
                    1) put the wsdlLocation in the implementing class, not the interface
                    2) put the wsdl in WEB-INF/wsdl for a while
                    3) edited the wron wsdl file, so I didn't see any changes when it deployed
                    4) had a syntax error in my wsdl file (caused it not to deploy)
                    5) some other dumb things.

                    @dwin Thanks for your posts!
                    @diesler Thanks for your continued activities in the forums, and your code.