CFINVOKE doesn't work with urls

Description

Java 11.0.10 (Oracle Corporation) 64bit
OS Linux (3.10.0-1160.21.1.el7.x86_64) 64bit
JBOSS EAP 7.3

I have been trying to access components using cfinvoke and always get an error message. The only way I can get it to work is through cfhttp.

When I use cfinvoke, I always get the following error:
XML document structures must start and end within the same entity.

The same component works just fine through cfhttp.

This fails:
{{<cfinvoke component="http://component.cfc" method="method" returnvariable="return">
<cfinvokeargument name="variable" value="#id#">
</cfinvoke>}}

This works:

<cfhttp url="http://component.cfc" method="get" result="result" charset="utf-8">
<cfhttpparam type="url" name="method" value="method">
<cfhttpparam type="url" name="variable" value="#id#">
</cfhttp>

Stack trace:
ucee.runtime.exp.NativeException: Fatal Error: URI=: Content is not allowed in prolog. at org.apache.axis.utils.XMLUtils$ParserErrorHandler.fatalError(XMLUtils.java:723) at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:181) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1471) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:978) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:541) at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888) at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824) at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at java.xml/com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:246) at java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339) at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:369) at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:420) at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:482) at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361) at java.base/java.lang.Thread.run(Thread.java:832) Caused by: org.xml.sax.SAXException: Fatal Error: URI=: Content is not allowed in prolog. … 19 more

Activity

Show:

Michael Offner 21 May 2024 at 20:01

this part of the project is deprecated and only get security fixes, sorry.

Pothys - MitrahSoft 13 May 2021 at 13:23

I've checked this ticket and confirmed the issue happened on lucee latest version 5.3.8.177-SNAPSHOT also. While accessing a component that runs on the ACF server using URL by cfinvoke webservice throws an error in lucee like ERROR: Missing soap: fault element inFault "testCFCInvocationException" in operation "testCFCInvocationException", in binding remotetest. Seems, In ACF can able to access a component running in Lucee.

Stacktrace
lucee.runtime.exp.NativeException: ERROR: Missing soap:fault element inFault "testCFCInvocationException" in operation "testCFCInvocationException", in binding remotetest
at org.apache.axis.wsdl.symbolTable.SymbolTable.faultsFromSOAPFault(SymbolTable.java:2858)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populateBindings(SymbolTable.java:2549)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:744)
at org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:543)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:518)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: ERROR: Missing soap:fault element inFault "testCFCInvocationException" in operation "testCFCInvocationException", in binding remotetest
... 8 more

Ian Rutherford 11 May 2021 at 12:01

The component is on a different server. We’ve been using registered services in the ACF admin for years. The services are all urls on a different server. They are all registered as https://[server]:[port]/[folder]/file.cfc?wsdl

I’ve been trying to test registered services on Lucee without success as well.

https://dev.lucee.org/t/no-rest-service-for-test-hello-world-found/8303/10

Pothys - MitrahSoft 11 May 2021 at 07:22

I've checked this ticket with both lucee affected version 5.3.7.48 and the latest version 5.3.8.175-SNAPSHOT. For me, Using URL in the component attribute for cfinvoke to access the component throws an error in both lucee and ACF. Using the component path in cfinvoke works fine for me.

The below the code throws same error above mentioned in both ACF and lucee.

<cfinvoke webService="http://url/component.cfc" method="test" returnvariable="return"></cfinvoke>

where is your component located?


Stack trace:
lucee.runtime.exp.NativeException: Fatal Error: URI=http://server/[URLpath]/test.cfc Line=2: Content is not allowed in prolog.
at org.apache.axis.utils.XMLUtils$ParserErrorHandler.fatalError(XMLUtils.java:723)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:369)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:420)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:482)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)


at java.lang.Thread.run(Unknown Source)
Caused by: org.xml.sax.SAXException: Fatal Error: URI=http://server/[URLpath]/test.cfc Line=2: Content is not allowed in prolog.
... 19 more

Ian Rutherford 5 May 2021 at 16:25

I've tried the following without success as well:

ws = createObject("webservice", "http://url/component.cfc");

(malformed xml)

ws = createObject("webservice", "http://url/component.wsdl"); (can't find file)

ws = createObject("webservice", "http://url/component.cfc?wsdl"); (missing soap fault)

<cfset result = component.method(variable,http://url/component.cfc)>

Fatal Error: URI=http://url/component.cfc Line=79: Content is not allowed in prolog

Adding output= and returnformat= to the cffunction tag doesn’t change the result.

 

Tested basic component remotely using cfinvoke:

Fatal Error: URI=http://url/remotetest.cfc Line=79: Content is not allowed in prolog.

<cfcomponent output="false" displayname="test">

<cffunction name="remotetest1" access="remote" returnType="string" returnformat="plain">

       <cfset test = "test">

       <cfreturn test>

</cffunction>

</cfcomponent>

Fixed

Details

Assignee

Reporter

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Priority

Created 5 May 2021 at 16:09
Updated 21 May 2024 at 20:01
Resolved 21 May 2024 at 20:01

Flag notifications