1 Reply Latest reply on Jun 26, 2008 3:50 AM by timeagentess

    new format required for wsdl in JBossws>2.0.0?

    timeagentess

      Hello all,

      I have some problems transitioning from JBoss 4.0.5 + JBossws 2.0.0 to JBoss 4.2.0 + JBossws 3.0.2.
      A simple web service (deployed as an annotated EJB within an ear) which was working perfectly in the initial configuration cannot be consumed by wsconsume in the second configuration:

      [wsconsume] Failed to read the WSDL document: http://nifhel:8080/webservices-ws/services/WSTwo?wsdl, because 1) could not find the document; /2) the document could not be read; 3) the root element of the document is not <wsdl:definitions>.
      [wsconsume] [ERROR] failed.noservice=Could not find wsdl:service in the provided WSDL(s):
      [wsconsume] At least one WSDL with at least one service definition needs to be provided.
      [wsconsume] Failed to parse the WSDL.
      ...


      My generated WSDL file indeed does not have a wsdl:service tag as root, it looks like this (with some parts eliminated for clarity):


      <definitions name='WSTwoServiceBeanService' targetNamespace='http://localhost:8080/atb' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://localhost:8080/atb' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
      <types>
      <xs:schema targetNamespace='http://localhost:8080/atb' version='1.0' xmlns:tns='http://localhost:8080/atb' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
      <xs:element name='hello' type='tns:hello'/>
      <xs:element name='helloResponse' type='tns:helloResponse'/>
      <xs:complexType name='hello'>
      <xs:sequence>
      <xs:element minOccurs='0' name='arg0' type='xs:string'/>
      </xs:sequence>

      </xs:complexType>
      <xs:complexType name='helloResponse'>
      <xs:sequence>
      <xs:element minOccurs='0' name='return' type='xs:string'/>
      </xs:sequence>
      </xs:complexType>
      </xs:schema>
      </types>
      [...]


      How can I influence the generation of a wsdl document which complies to what wsconsume seems to expect? Or is there another mistake I might have made?

      Additional things I tried: Searching around led me to this forum post: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102431
      and this JIRA issue: http://jira.jboss.org/jira/browse/JBESB-1719, which seem (?) to be related to my problem.

      Setting fork="true" for wsconsume like suggested in the forum post linked above led to the gnu.getopt.LongOpt class to be reported as not found, and after adding the corresponding jar to the classpath I get an almost identical error to the one I've started with:
      [wsconsume] parsing WSDL...
      [wsconsume] [ERROR] Connection reset
      [wsconsume] Failed to read the WSDL document: http://nifhel:8080/webservices-ws/services/WSTwo?wsdl, because 1) could not find the document; /2) the document could not be read; 3) the root element of the document is not <wsdl:definitions>.
      [wsconsume] [ERROR] failed.noservice=Could not find wsdl:service in the provided WSDL(s):
      [wsconsume] At least one WSDL with at least one service definition needs to be provided.
      [wsconsume] Failed to parse the WSDL.
      [wsconsume] Failed to invoke WsImport
      [wsconsume] java.lang.IllegalStateException: WsImport invocation failed. Try the verbose switch for more information
      [wsconsume] at org.jboss.ws.tools.jaxws.impl.SunRIConsumerImpl.consume(SunRIConsumerImpl.java:234)
      [wsconsume] at org.jboss.wsf.spi.tools.cmd.WSConsume.importServices(WSConsume.java:223)
      [wsconsume] at org.jboss.wsf.spi.tools.cmd.WSConsume.main(WSConsume.java:81)
      [wsconsume] Error: Could not import. (use --verbose to see full traces)
      [wsconsume] java.lang.IllegalStateException: WsImport invocation failed. Try the verbose switch for more information
      [wsconsume] at org.jboss.ws.tools.jaxws.impl.SunRIConsumerImpl.consume(SunRIConsumerImpl.java:234)
      [wsconsume] at org.jboss.wsf.spi.tools.cmd.WSConsume.importServices(WSConsume.java:223)
      [wsconsume] at org.jboss.wsf.spi.tools.cmd.WSConsume.main(WSConsume.java:81)


      Can anyone help with this issue?
      Thank you very much!

        • 1. Re: new format required for wsdl in JBossws>2.0.0?
          timeagentess

          Never mind, solved -- my bad ;)

          For some reason, when working with the newer JBossWS, the wsconsume build script did not know how to resolve the localhost name in the given wsdl location to "localhost" and the wsdl was not found. Replacing the actual name with "localhost" solved the problem.

          Hopefully this helps someone.