1 Reply Latest reply on Nov 23, 2011 3:19 PM by Richard Opalka

    jax-ws-catalog.xml

    Philippe Gervaise Newbie

      Hello,

       

      I want to use "jax-ws-catalog.xml" feature (different environnements for a web service AND some WSDL does not contains the good endpoint IP due to proxies).

       

      First I try to package "jax-ws-catalog.xml" in a library (JAR) packaged into a WAR. It works with JBoss 4 but not with JBoss 7.0.2.

       

      So I made a simplier test (attached file) for JBoss 7 :

       

      Made a simple index.jsp page (for webservice http://api.notificationmessaging.com/NMSOAP/NotificationService?wsdl) :

       

      <%
          java.net.URL wsdlLocation =
              new java.net.URL("http://fake.url/NotificationService.wsdl");
      
          javax.xml.namespace.QName qName =
              new javax.xml.namespace.QName("http://api.service.nsapi.emailvision.com/", "NotificationServiceService");
      
          new javax.xml.ws.Service(wsdlLocation, qName) { };
      %>
      

       

      A created jax-ws-catalog.xml in /WEB-INF/classes/META-INF/ directory :

       

      <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
          <system systemId="http://fake.url/NotificationService.wsdl" uri="NotificationService.wsdl"/>
      </catalog>
      

       

      Also created NotificationService.wsdl file in same directory of the jax-ws-catalog.xml file (from the url above).

       

      Finally got an exception on http://localhost:8080/test/index.jsp :

       

      javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'http://fake.url/NotificationService.wsdl'.: java.net.UnknownHostException: fake.url
       com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
       com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
       com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
       org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:239)
       org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:186)
       org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:92)
       org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:203)
       org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:147)
       org.jboss.wsf.stack.cxf.client.ProviderImpl.createServiceDelegate(ProviderImpl.java:141)
       javax.xml.ws.Service.<init>(Service.java:57)
       org.apache.jsp.index_jsp$1.<init>(index_jsp.java:61)
       org.apache.jsp.index_jsp._jspService(index_jsp.java:61)
       org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
       org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
       org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326)
       org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
       javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
      

      How to make it works with JBoss 7 ? In the end I want to embed NotificationService.wsdl in a JAR (meta-inf dir) and use jax-ws-catalog.xml to inject the good wsdl file from classpath.

       

      Thank you.