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

webservice error

Explorer ,
Feb 22, 2007 Feb 22, 2007

Copy link to clipboard

Copied

Anyone ever see this when using a webservice?


Fatal Error: URI=null Line=2: The document type declaration for root element type "html" must end with '>'.

org.xml.sax.SAXException: Fatal Error: URI=null Line=2: The document type declaration for root element type "html" must end with '>'. at org.apache.axis.utils.XMLUtils$ParserErrorHandler.fatalError(XMLUtils.java:723) at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl.scanDoctypeDecl(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11


This is a webservice that runs via multiple incarnations of the same code... different domains all pointing to the same code base, but pulling from different dbs and content folders. The ws works fine on all sites tested, except for one site. I've tested the method by calling it as a component and there doesn't appear anything untoward in the output (with no errors when called as a comp).

Thoughts?

Googling the error brings up 30 hits, about 20 of which are on blogspot, and this one:

http://www.w3.org/Bugs/Public/show_bug.cgi?id=2471

I'm carnfused.

Michael
TOPICS
Advanced techniques

Views

1.1K

Translate

Translate

Report

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
Explorer ,
Feb 22, 2007 Feb 22, 2007

Copy link to clipboard

Copied

This is part of the message as well..

Could not generate stub objects for web service invocation.

Votes

Translate

Translate

Report

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
Explorer ,
Feb 23, 2007 Feb 23, 2007

Copy link to clipboard

Copied

bump

Votes

Translate

Translate

Report

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
LEGEND ,
Feb 23, 2007 Feb 23, 2007

Copy link to clipboard

Copied

Are you 100% positive that you are correctly connecting to the web service?

Glancing at your error, the first thought that came to my head was that
a IIS error page or some other unexpected content is being returned. In
my experience this content has never been well formed XML and throws
errors like this when a process tries to use it as such.

Other then that idea more information about the web service and how you
are calling it would help.

Votes

Translate

Translate

Report

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
Engaged ,
Feb 23, 2007 Feb 23, 2007

Copy link to clipboard

Copied

Try clearing out the /stubs folder and rerun the service. Maybe one of the cached WS is corrupt.

Votes

Translate

Translate

Report

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
Explorer ,
Feb 23, 2007 Feb 23, 2007

Copy link to clipboard

Copied

This is how I'm calling it:

----------------------------
<cfinvoke
webservice=" http://xxxxxxx.com/_xxxxxxx.cfc?wsdl"
method="getFTPInfo"
returnvariable="xxx">
<cfinvokeargument name="userName" value="xxxxx">
<cfinvokeargument name="userPassword" value="xxxxx">
</cfinvoke>
<cfdump var="#xmlParse(xxx)#" label="getFTPInfo">
<cfcatch type="Any">
<h1>Error</h1>
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
----------------------------

The error is thrown by the first CFDUMP. Here's the "Detail" at the top of the caught dump:

----------------------------
Name: http://xxxxxx.com/_xxxxxxxxxx.cfc?wsdl. WSDL: http://xxxxxxx.com/_xxxxxxxxxxxx.cfc?wsdl. org.xml.sax.SAXException: Fatal Error: URI=null Line=2: The document type declaration for root element type "html" must end with '>'. It is recommended that you use a web browser to retrieve and examine the requested WSDL document for correctness. If the requested WSDL document can't be retrieved or it is dynamically generated, it is likely that the target web service has programming errors.
----------------------------

When I look at the _xxxxxxxxxx.cfc?wsdl as suggested, in the browser, it loads fine. No hassles.

If I call the method via componant, thusly:

----------------------------
<cftry>
<cfinvoke
component="_xxxxxxxxx"
method="getFTPInfo"
returnvariable="xxx">
<cfinvokeargument name="userName" value="xxxxxx">
<cfinvokeargument name="userPassword" value="xxxxxx">
</cfinvoke>
<cfdump var="#xmlParse(xxx)#" label="getFTPInfo">
<cfcatch type="Any">
<h1>Error</h1>
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
----------------------------

It works fine, no errors.

As mentioned above, this exact service works on other domains (all running the same code base on the same server, just coming in via different domains and calling data from different dbs)

My first thought was that the info being sent back may have some illegal characters, but that's not the case. See code snippet below to see the kind of data that is being sent back.

Abinidi I did clear the /stubs folder and no change. Also went into the Administrator and saw that this ws hadn't yet been registered there.

Votes

Translate

Translate

Report

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
LEGEND ,
Feb 23, 2007 Feb 23, 2007

Copy link to clipboard

Copied

</cfinvoke>

<cfouput>#xxx#</cfoutput>

<cfdump var="#xmlParse(xxx)#" label="getFTPInfo">
----------------------------

The error is thrown by the first CFDUMP. Here's the "Detail" at the
top of the caught dump:

What do you get if you just output xxx. Is it the expected result and
is it well formed xml?

Votes

Translate

Translate

Report

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
Explorer ,
Feb 23, 2007 Feb 23, 2007

Copy link to clipboard

Copied

LATEST
Never gets there. Apparently the call itself is having a problem. Here's the error (below).

If I change the url and un/pw (which, again, is going to the exact same code, just a different db) I get no error. Here's the output, unparsed:

<?xml version='1.0'?><alldata><userpassword>xxxxxx</userpassword> <ftp_user>xxxxxx</ftp_user><siteactive>1</siteactive><status>OK</status><username>xxxxxx</username> <ftp_server>xxxxxxx.com</ftp_server> <siteroot> http://xxxxxx.com/d0001/LocalUser/xxxxxxx/</siteroot><hostactive>1</hostactive> <ftp_password>xxxxxx... Technologies, Inc.</hostname><siteid>239</siteid></alldata>

Votes

Translate

Translate

Report

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
Explorer ,
Feb 23, 2007 Feb 23, 2007

Copy link to clipboard

Copied

Just to make sure you understand, this code works fine on other instances, ie; all I have to do is change the domain name, un and pw to another site and it works fine. It's just this one site's instance that is giving me trouble. All it can be then is the data, right? Or perhaps something's up with the internals that is causing an error, which manifests as the xml error we see above... but that can't be true since I can call it as a component and I get no errors with the same exact un/pw data.

Votes

Translate

Translate

Report

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
Documentation