Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6388460

Endpoint publish produce an error if wsdl is encoded in UTF-16The following pseudo-code produces err

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 6
    • 6
    • xml
    • b84
    • generic
    • generic

      The following pseudo-code produces error if <wsdl> is encoded in UTF-16
          (please find the actual code and ant build-script in attachement):

              Endpoint endpoint = Endpoint.create(...);
              URL wsdlURL=new URL(<location of wsdl>);
              endpoint.setMetadata( List<Source>
              {
                      new StreamSource(wsdlURL.openStream(),wsdlURL.toExternalForm())
              });
              
              endpoint.publish("http://localhost:8880/hello");

          The exception stack trace is:

          Server Runtime Error: XML reader error: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,42]
          Message: Content is not allowed in prolog.
                  at com.sun.xml.ws.transport.http.server.HttpEndpoint.publish(HttpEndpoint.java:185)
                  at com.sun.xml.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:65)
                  at Main.doTest(Main.java:34)
                  at Main.main(Main.java:19)
          Caused by: XML reader error: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,42]
          Message: Content is not allowed in prolog.
                  at com.sun.xml.ws.streaming.XMLStreamReaderUtil.wrapException(XMLStreamReaderUtil.java:251)
                  at com.sun.xml.ws.streaming.XMLStreamReaderUtil.next(XMLStreamReaderUtil.java:78)
                  at com.sun.xml.ws.streaming.XMLStreamReaderUtil.nextContent(XMLStreamReaderUtil.java:93)
                  at com.sun.xml.ws.streaming.XMLStreamReaderUtil.nextElementContent(XMLStreamReaderUtil.java:83)
                  at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.fillDocInfo(RuntimeWSDLParser.java:110)
                  at com.sun.xml.ws.server.RuntimeEndpointInfo.fillDocInfo(RuntimeEndpointInfo.java:791)
                  at com.sun.xml.ws.transport.http.server.HttpEndpoint.fillEndpointInfo(HttpEndpoint.java:158)
                  at com.sun.xml.ws.transport.http.server.HttpEndpoint.publish(HttpEndpoint.java:220)
                  at com.sun.xml.ws.transport.http.server.HttpEndpoint.publish(HttpEndpoint.java:179)
                  ... 3 more
          Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,42]
          Message: Content is not allowed in prolog.
                  at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:544)
                  at com.sun.xml.ws.streaming.XMLStreamReaderUtil.next(XMLStreamReaderUtil.java:59)
                  ... 10 more

            sreddysunw Sunitha Reddy (Inactive)
            avishentsunw Alexey Vishentsev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: