1 Reply Latest reply on May 5, 2009 12:29 PM by Angus Morison

    Obscure 'SAXParseException: Content is not allowed in prolog

    Angus Morison Newbie

      I have a 'Content is not allowed in prolog' problem. But I am pretty sure that it is not any of the usual culprits (spaces or invalid characters where they should not be).

      I have a WSDL (below). This is for a document type WS, and the schema is at http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4.xsd .
      I have verified that the WSDL is WSI Basic Profile 1.1 with soapUI and the WS-I Testing Tools V1.1.
      It is correctly parsed and treated by wsconsume.
      The server application is correctly deployed. But when I try to run the client I get (full stack trace below)

      WSDLException (at /definitions/types/xs:schema/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'http://schemas.xmlsoap.orgsoap/envelope/'.: org.xml.sax.SAXParseException: Content is not allowed in prolog.
      It seems to get stuck parsing the soap envelope schema, which is imported into the 3GPP schema. (I have validated the 3GPP schema with http://www.w3.org/2001/03/webdata/xsv).

      JBossWS : version.id=3.0.1-native-2.0.4.GA.

      As ever, any suggestions ideas infinitely appreciated.

      WSDL:
      (I changed the WSDL soap NS to soapx as I thought there might be conficts with the 3GPP NS soap, but it did not make any difference)
      <?xml version="1.0" encoding="UTF-8"?>
      <definitions name="MM7Service" targetNamespace="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4" xmlns:tns="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapx="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
       <types>
      <xs:schema targetNamespace="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4" xmlns:tns="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" elementFormDefault="qualified" attributeFormDefault="unqualified">
       <xs:include schemaLocation="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4.xsd"/>
      </xs:schema>
       </types>
       <message name="MM7_SubmitReq">
       <part name="SubmitReq" element="tns:SubmitReq">
       </part>
       </message>
       <message name="MM7_SubmitRsp">
       <part name="SubmitReq" element="tns:SubmitRsp">
       </part>
       </message>
       <portType name="MM7">
       <operation name="submit">
       <input message="tns:MM7_SubmitReq">
       </input>
       <output message="tns:MM7_SubmitRsp">
       </output>
       </operation>
       </portType>
       <binding name="MM7Binding" type="tns:MM7">
       <soapx:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
       <operation name="submit">
       <soapx:operation soapAction=""/>
       <input>
       <soapx:body use="literal"/>
       </input>
       <output>
       <soapx:body use="literal"/>
       </output>
       </operation>
       </binding>
       <service name="MM7Service">
       <port name="MM7Port" binding="tns:MM7Binding">
       <soapx:address location="REPLACE_WITH_ACTUAL_URL"/>
       </port>
       </service>
      </definitions>
      


      Stack Trace:
      09:44:35,338 TRACE [JBossEntityResolver] Mapped systemId to filename:
      09:44:35,338 TRACE [JBossEntityResolver] maps to URL: file:/C:/Other/eclipseall/ws/hsi/mm7-client2/bin/
      [Fatal Error] :1:1: Content is not allowed in prolog.
      Exception in thread "main" org.jboss.ws.metadata.wsdl.WSDLException: javax.wsdl.WSDLException: WSDLException (at /definitions/types/xs:schema/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'http://schemas.xmlsoap.org/soap/envelope/'.: org.xml.sax.SAXParseException: Content is not allowed in prolog.
       at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:152)
       at org.jboss.ws.metadata.umdm.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:293)
       at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.buildMetaData(JAXWSClientMetaDataBuilder.java:84)
       at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegateImpl.java:136)
       at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:63)
       at javax.xml.ws.Service.<init>(Service.java:79)
       at org._3gpp.ftp.specs.archive._23_series._23_140.schema.rel_6_mm7_1_4.MM7Service.<init>(MM7Service.java:41)
       at test.client.MM7ClientTest2.main(MM7ClientTest2.java:25)
      Caused by: javax.wsdl.WSDLException: WSDLException (at /definitions/types/xs:schema/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'http://schemas.xmlsoap.org/soap/envelope/'.: org.xml.sax.SAXParseException: Content is not allowed in prolog.
       at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.getDocument(JBossWSDLReaderImpl.java:2136)
       at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.parseSchema(JBossWSDLReaderImpl.java:832)
       at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.parseSchema(JBossWSDLReaderImpl.java:866)
       at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.parseSchema(JBossWSDLReaderImpl.java:656)
       at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.parseTypes(JBossWSDLReaderImpl.java:617)
       at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.parseDefinitions(JBossWSDLReaderImpl.java:329)
       at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.readWSDL(JBossWSDLReaderImpl.java:2290)
       at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.readWSDL(JBossWSDLReaderImpl.java:2254)
       at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.readWSDL(JBossWSDLReaderImpl.java:2307)
       at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.readWSDL(JBossWSDLReaderImpl.java:2328)
       at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.readWSDL(JBossWSDLReaderImpl.java:2360)
       at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:125)
       ... 7 more
      Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
       at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
       at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
       at org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.getDocument(JBossWSDLReaderImpl.java:2126)
       ... 18 more


      Client program:
      private final static String WSDL_HTTP = "http://frpar-morisona1:8080/mm7/MM7Bean?wsdl";
      
       private final static String NAMESPACE = "http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4";
      
      
       public static void main(String[] args) throws Exception {
      
       MM7Service serv = new MM7Service(new URL(WSDL_HTTP), new QName(NAMESPACE, "MM7Service"));
      
       MM7 port = serv.getMM7Port();
      
       SubmitReqType submitReq = new SubmitReqType();
      
       SubmitRspType submitRsp = port.submit(submitReq);
       }


        • 1. Re: Obscure 'SAXParseException: Content is not allowed in pr
          Angus Morison Newbie

          Looking further at this, I think the trace before it blows up is relevent. it is definitely parsing the soap envelope schema:

          2009-05-05 18:03:59,380 DEBUG [org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory] parse: http://frpar-morisona1:8080/mm7/MM7Bean?wsdl
          2009-05-05 18:03:59,568 TRACE [org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory] getBaseInputSource [wsdlUrl=http://frpar-morisona1:8080/mm7/MM7Bean?wsdl]
          2009-05-05 18:03:59,677 TRACE [org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory] getImportInputSource [parent=http://frpar-morisona1:8080/mm7/MM7Bean?wsdl,resource=http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4.xsd]
          2009-05-05 18:03:59,677 TRACE [org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory] Trying to resolve: http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4.xsd
          2009-05-05 18:03:59,677 DEBUG [org.jboss.ws.core.utils.JBossWSEntityResolver] resolveEntity: [pub=http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4.xsd,sysid=http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4.xsd]
          2009-05-05 18:03:59,677 TRACE [org.jboss.util.xml.JBossEntityResolver] resolvePublicID, publicId=http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4.xsd
          2009-05-05 18:03:59,677 TRACE [org.jboss.util.xml.JBossEntityResolver] resolveSystemID, systemId=http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4.xsd
          2009-05-05 18:03:59,677 TRACE [org.jboss.util.xml.JBossEntityResolver] resolveClasspathName, systemId=http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4.xsd
          2009-05-05 18:03:59,677 TRACE [org.jboss.util.xml.JBossEntityResolver] Mapped systemId to filename: REL-6-MM7-1-4.xsd
          2009-05-05 18:03:59,677 TRACE [org.jboss.util.xml.JBossEntityResolver] resolveSystemIDasURL, systemId=http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4.xsd
          2009-05-05 18:03:59,677 TRACE [org.jboss.util.xml.JBossEntityResolver] Trying to resolve systemId as a URL
          2009-05-05 18:04:00,115 TRACE [org.jboss.util.xml.JBossEntityResolver] Resolved systemId as a URL
          2009-05-05 18:04:00,287 TRACE [org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory] getImportInputSource [parent=http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4.xsd,resource=http://schemas.xmlsoap.org/soap/envelope/]
          2009-05-05 18:04:00,287 TRACE [org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory] Trying to resolve: http://schemas.xmlsoap.org/soap/envelope/
          2009-05-05 18:04:00,287 DEBUG [org.jboss.ws.core.utils.JBossWSEntityResolver] resolveEntity: [pub=http://schemas.xmlsoap.org/soap/envelope/,sysid=http://schemas.xmlsoap.org/soap/envelope/]
          2009-05-05 18:04:00,287 TRACE [org.jboss.util.xml.JBossEntityResolver] resolvePublicID, publicId=http://schemas.xmlsoap.org/soap/envelope/
          2009-05-05 18:04:00,287 TRACE [org.jboss.util.xml.JBossEntityResolver] resolveSystemID, systemId=http://schemas.xmlsoap.org/soap/envelope/
          2009-05-05 18:04:00,302 TRACE [org.jboss.util.xml.JBossEntityResolver] resolveClasspathName, systemId=http://schemas.xmlsoap.org/soap/envelope/
          2009-05-05 18:04:00,302 TRACE [org.jboss.util.xml.JBossEntityResolver] Mapped systemId to filename:
          2009-05-05 18:04:00,302 TRACE [org.jboss.util.xml.JBossEntityResolver] maps to URL: file:/C:/Other/eclipseall/ws/hsi/mm7-client2/bin/