1 Reply Latest reply on Jan 9, 2014 4:39 AM by wolowizard

    Wrong schemaLocation for swaref in WSDL

    wolowizard Newbie

      Hi.

       

      I am using the latest Jboss EAP 6.2 and I see som trouble when in comes to using swaref and the wsdl that is generated. I have generated a small code that reproduces the error:

      MyService.java:

      @WebService(targetNamespace="http://mytest.com/mys")
      public class MyService {
      
           @WebMethod
           public MyAttachment getAttachment() {
                return new MyAttachment(new DataHandler("Hello", "text/xml; charset=UTF-8"));
           }
           
      }
      

      MyAttachment.java

      @XmlAccessorType(XmlAccessType.FIELD)
      @XmlType(name = "myAttachment", propOrder = { "dataHandler" })
      public class MyAttachment {
          
          @XmlElement
          @XmlAttachmentRef
          protected DataHandler dataHandler;
      
          public MyAttachment() { }
      
          public MyAttachment(DataHandler dataHandler) {
              this.dataHandler = dataHandler;
          }
      
          public DataHandler getDataHandler() {
              return dataHandler;
          }
      
          public void setDataHandler(DataHandler fagpersonHandler) {
              this.dataHandler = fagpersonHandler;
          }
      }
      

      I build this, and check out the WSDL, there is an odd line in the beginning of the WSDL:

       

      <xs:import namespace="http://ws-i.org/profiles/basic/1.1/xsd" schemaLocation="http://localhost:8080/soaptest/mys?xsd=http://ws-i.org/profiles/basic/1.1/swaref.xsd"/>

       

      What I expect is

       

      <xs:import namespace="http://ws-i.org/profiles/basic/1.1/xsd" schemaLocation="http://ws-i.org/profiles/basic/1.1/swaref.xsd"/>


      Why has the localhost-thing been added at the start of the schemalocation?


      I have seen that there has been some CXF-issues with the use of swaref before, but that is marked as solved. Any ideas on this? I will attach the complete wsdl as a text file.


      Thank you in advance.

        • 1. Re: Wrong schemaLocation for swaref in WSDL
          wolowizard Newbie

          Update:

           

          Even when overriding the wsdlLocation with my own wsdl, the schemalocation for swaref gets overridden with the localhost-bug. I have tried looking in the cxf-library that is used and it looks OK by me, so it is almost impossible to pinpoint where the bug is.

           

          And when the server starts, it says: 10:30:56,580 INFO  [org.jboss.ws.cxf.deployment] (MSC service thread 1-3) JBWS024074: WSDL published to: file:/C:/jboss-eap-6.2/......

           

          And this WSDL is correct. So I am starting to wonder if it is jbossws or something that intercepts and rewrite the wsdl when I request it in the browser. Any ideas where in the jboss source I can look?