Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Receiving [Fatal Error] :1:1: Content is not allowed in prolog.

New Here ,
Nov 05, 2013 Nov 05, 2013

The web service is written to return:

<?xml version="1.0" encoding="utf-8"?>

<UserContactInfo xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd=http://www.w3.org/2001/XMLSchema xmlns=http://tempuri.org/>

<Firstname>Nelson</Firstname>

<Lastname>Broat</Lastname>

</UserContactInfo>

But somehow Cold Fusion 9 is seeing it as

XMLData is org.tempuri.UserContactInfo@16259b42

which must be why we have the prolog error.

<cfinvoke webservice=http://ouripaddress/folder/servicename.asmx?WSDL method="GetUserBio" returnvariable="XMLData" refreshwsdl="true">

   <cfinvokeargument name="uuid" value="#authuser#"/>

</cfinvoke>

<cfdump var="XMLData is #XMLData# output="console" />

<cfset trimXMLdata = trim(XMLData) />

<cfset tmpXML = XMLParse(trimXMLData) />

This webservice was written in .net   and runs off a 64-bit computer running Windows 2008 Server R2

Is there something special we need to do here? The above value of XMLData looks like some sort of array pointer or something.

Any and all help and advice is appreciated. Thanks.

Nelson

1.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 05, 2013 Nov 05, 2013

During parsing the XML String use following code, it may solve your issue:

<cfset tmpXML = XmlParse( REReplace( trim(XMLData), "^[^<]*", "", "all" ) ) />

For more details about the issue and solution. Please follow this URL: http://www.bennadel.com/blog/1206-Content-Is-Not-Allowed-In-Prolog-ColdFusion-XML-And-The-Byte-Order...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 06, 2013 Nov 06, 2013
LATEST

Thanks.

I now have:

11/06 09:47:29 Information [jrpp-1] - Starting Web service request.

11/06 09:47:29 Information [jrpp-1] - Creating Web service proxy {url='http://ipaddremovedforsecurity/folder/program.asmx?WSDL'}

11/06 09:47:53 Information [jrpp-1] - Web service request completed {Time taken=24227 ms}

XMLData is xxx.yyy.zzz.services.UserContactInfo@ddc2fd04

[Fatal Error] :-1:-1: Premature end of file.

For ...

<cfdump var="XMLData is #XMLData#" output="console" />

<cfset tmpXML = XMLParse ( REReplace( trim(XMLData), "^[^<]*", "", "all"))  />

<cfdump var="tmpXML is #tmpXML#" output="console" />

So I can only guess I should speak with the webservices programmer at this point to see what changes, if any, he has made to his webservice.

I don't believe he has though, but I could be wrong.

Thanks again. So its a character, but not a blank character.

Nelson

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources