<CFINVOKE> Tag - ColdFusion
>> Return to ColdFusion Tag Index
The <CFINVOKE> tag allows you ...
<CFINVOKE> Comments from Macromedia LiveDocs
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
For anyone having trouble using cfinvoke to call a cfc function....if you have recently updated the cfc function's attributes (e.g. - name, arguments, etc..) you need to restart the ColdFusion service.
I believe this is due to a caching issue with the wsdl file created and stored by ColdFusion.
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
Make sure you are not inheriting Application.cfm from top.
I got the same error and I created blank Application.cfm in the same folder with component and it works fine.
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
After spending an hour trying to write an cfinvoke and .cfc for a user login I realized something that might seem obvious to some, but for others it can be quite a pain. You cannot pass USERNAME and PASSWORD as arguments to a cffunction. I found if you change it to usrname and passwd or anything else like that it works fine but otherwise it gives you an error if you require those arguments.
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
milburgr,
Here is the link you requested http://www.richarddavies.us/archives/2006/02/enabling_web_services.php
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
The url above is out of service... any chance someone can post the contents of http://www.richarddavies.us/archives/2006/02/enabling_web_se_1.php
?
Thanks,
Greg
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
for all those having the 'Could not generate stub objects...' problems, check out http://www.richarddavies.us/archives/2006/02/enabling_web_se_1.php
he's got the solution
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
Hi guys
The issue with 'Could not generate stub objects for web service invocation. ' seem to be with your Firewall. You need to grant access to the JRun Jar Launcher. I have Zone Alarm and given the right access it works.
It feels good to be back into Coldfusion after three years. Ohh Yes.
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
Folks, the comment of the "syntax 2" example and indeed the first line of the page both suggest that using <cfinvoke method="somefunction"> without a COMPONENT attribute can be used only "within a component". That doesn't recognize that CFFUNCTIONs can exist outside a CFC, and indeed this CFINVOKE syntax can call such a method without regard to CFCs.
As such, the first line ("Invokes a component method from within a ColdFusion page or component") and the syntax 2 comment ("this syntax can invoke a method of a component only from within the component") aren't quite accurate.
The problem exists in the CFMX 7 docs as well, and no one has commented on this there. I don't suppose you want people repeating such observations in both livedocs pages. Is it reasonable for us to hope that comments made here that were offered after CFMX 7's release may still influence future doc updates?
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
Handling Complex response
<cfinvoke
webservice="http://webserviceprovider.com/wsdl/?WSDL"
method="method"
returnvariable="ReturnArray">
<cfinvokeargument name="var_name1" value="value1"/>
<cfinvokeargument name="var_name2" value="value2"/>
<cfinvokeargument name="var_name3" value="value3"/>
</cfinvoke>
<cfset customArr= arrayNew(1)>
<cfloop index="i" from="1" to="5">
<cfscript>
ResponseArr = StructNew( );
ResponseArr.Var1 = ReturnArray[i].Var1;
ResponseArr.Var2 = ReturnArray[i].Var2;
ResponseArr.Var3 = ReturnArray[i].Var3;
customArr[i] = ResponseArr;
</cfscript>
</cfloop>
<cfdump var="#customArr#">
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
Hi,
I found the solution of the problem I had related to calling web service from CF and in my web service, I had complex parameter, and I couldn't figure out how to supply this from CF and now I have changed the interface of WS to accept normal params and it started working.
Thanks
Philip
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
Hi,
I am trying to invoke a webservice which is running under Jrun4 using axis framwork and developed in Java. When I call this web service using java client it works fine but when I call it from cf 7 page it throws error:
Here is how I am invoking it:
<cfinvoke method="getTemplateParameters" returnvariable="aString"
webservice="http://5.0.5.1:8300/axis/services/theDna">
<cfinvokeargument name="templatePathName" value="customer/client/headline"/>
<cfinvokeargument name="templateName" value="testtemp.xml"/>
</cfinvoke>
<cfoutput>#aString#</cfoutput>
And the error message is:
Could not generate stub objects for web service invocation.
Name: http://5.0.5.1:8300/axis/services/theDna. WSDL: http://5.0.5.1:8300/axis/services/theDna. org.xml.sax.SAXException: Fatal Error: URI=null Line=2: The markup in the document following the root element must be well-formed. 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.
The error occurred in F:\Inetpub\sites\Tracker\testws.cfm: line 60
58 : webservice="http://5.0.5.1:8300/axis/services/theDna">
59 : <cfinvokeargument name="templatePathName" value="customer/client/headline"/>
60 : <cfinvokeargument name="templateName" value="testtemp.xml"/>
61 : </cfinvoke>
And if I change follwing webservice="http://5.0.5.1:8300/axis/services/theDna">
with webservice="http://5.0.5.1:8300/axis/services/theDna?wsdl">
Then I get this error:
Web service operation "getTemplateParameters" with parameters {templatePathName={customer/client/headline},templateName={testtemp.xml},} could not be found.
The error occurred in F:\Inetpub\sites\Tracker\testws.cfm: line 60
58 : webservice="http://5.0.5.1:8300/axis/services/theDna?wsdl">
59 : <cfinvokeargument name="templatePathName" value="customer/client/headline"/>
60 : <cfinvokeargument name="templateName" value="testtemp.xml"/>
61 : </cfinvoke>
And it runs fine from Java client.
Could some one suggest me, what I am missing?
Thanks
Philip
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
I am trying to invoke a web service that returns a complex XML document string.,
I try to do the following:
<cfinvoke
webservice="http://www.domain.nett/portal/eig/services/assignment?wsdl"
method="getAssignmentCount"
returnvariable="aAssignmentsType">
<cfinvokeargument name="userID" value="userid"/>
<cfinvokeargument name="userPassword" value="password"/>
</cfinvoke>
<cfset mydoc = XmlParse(aAssignmentsType)>
<cfdump var="#mydoc#">
And I get the following:
An error occured while Parsing an XML document.
Content is not allowed in prolog.
I am brand new to this stuff, please help me understand what is incorrect?
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
FYI, a developer has reported that he had a problem using cfinvoke to
call a web service with multiple arguments, but was able to solve it
by using cfscript instead.
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
For those having trouble calling remote cfc's as web services (ie. strange errors like "must have '>' terminate comment etc...), try adding an Application.cfm file to the directory in which the cfc's exist.
something very simple, like
<cfapplication name = "cfc">
That will allow any aggregator, site partner, etc to access the wsdl file freely, without having any code that is included in your higher level Application.cfm file getting in the way. I don't know, worked for me.
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
I'm having trouble call a specific method of a webservice. I can call all the other methods, but the one I want to call exists in a different port/binding.
Is there anyway to specify the port/binding when calling the methd?
Info:
http://live.capescience.com/GlobalWeather/index.html
http://live.capescience.com/wsdl/GlobalWeather.wsdl
My Code:
<cfinvoke webservice="http://live.capescience.com/wsdl/GlobalWeather.wsdl"
method="getWeatherReport"
returnvariable="weather">
<cfinvokeargument name="code" value="CYYZ">
</cfinvoke>
Returns:
Web service operation "getWeatherReport" with parameters {code={CYYZ},} could not be found.
Any thoughs? Thanks
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
If you open that wsdl url directly in a browser, you should see an xml formatted file. If you are seeing the Could not generate stub objects for web service invocation error, there is most likely an error being thrown by your web service cfc. You can read this error by opening the wsdl url - for instance, a common error is to not specify return types for remote functions. The entire cfc must be error free, as it gets compiled to generate the web service. You may need to use mozilla to view the error, as IE can replace an error message with a generic "unable to display page" error.
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
How does one invoke a _messaging_ Web Service?
I've been able to invoke RPC style Web Services, explicity passing the
required parameters by name, but how is such a mechanism to be
applied to a messaging service?
Do I build the SOAP Envelope myself, and if so, exactly how much of it
do I need to create?
How much of the Envelope does CF handle / What does CF expect the
developer to provide?
Does CF generate the required SOAPContext "request" and "response"
parameters, or will I need to generate those myself?
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
Also, one more thing that is "odd" to me, when i browse to this page: http://dbsic/getServerlist.cfc?wsdl
The generated xml has this (notice the targetNamespace is not my servername):
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions targetNamespace="http://DefaultNamespace" xmlns:impl="http://DefaultNamespace" xmlns:intf="http://DefaultNamespace"
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
I am having the exact same problem trying to test a web service that is a simple select statement. If I invoke the component it works fine, but if I invoke the web service it fails with this:
Could not generate stub objects for web service invocation.
Name: http://dbsic/getServerlist.cfc?wsdl. WSDL: http://dbsic/getServerlist.cfc?wsdl. org.xml.sax.SAXException: Fatal Error: URI=null Line=1: Next character must be ">" terminating comment . 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.
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
mossy_77 : same problem... did you solve the problem ? work around ? On out server, the webservice works great, and after a few hours (it depends) we get that error...
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
That previous error was generated when I had:
<cfinvoke webservice="http://#URL.server#/components/web_services.cfc?wsdl"
method="getPreview"
timeout = "200"
strStructName = "#URL.structname#"
returnvariable="structPreview">
When I take the timeout attribute away:
<cfinvoke webservice="http://#URL.server#/components/web_services.cfc?wsdl" method="getPreview"
strStructName = "#URL.structname#"
returnvariable="structPreview">
I still get this error:
Could not generate stub objects for web service invocation. We are sorry.
There was an error processing this page.
Date: {ts '2004-10-08 10:16:05'}
Message: Could not generate stub objects for web service invocation.
java.net.ConnectException: Connection refused: connect 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.
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
I am attempting to invoke a webservice on 3 different servers 2 of them don't work. I get:
Could not generate stub objects for web service invocation. We are sorry.
There was an error processing this page.
Date: {ts '2004-10-08 10:00:53'}
Message: Could not generate stub objects for web service invocation.
Detail: Name: java.io.InterruptedIOException: Connection establishment timed out 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 place the webservice URL in the browser it displ;ays the soap definition perfectly. Cold fusion can see the webservice but won't allow it to connect. There ore no proxies, passwords or ssl involved.
Also why does it work in one identical environment and not another.
Regardss
Mossy_77
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
Error 51904. In my instance it is always the third parameter sent, no matter what order the parameters pairs are sent in. Even a parameter with type string defined in the wsdl does not work. Is theie going to be a update soon.
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
Can you provide any other info on bug 51904? Is there a work around or a hot fix?
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
This is a known bug, number 51904.
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
I am passing the numeric value 80 into a function within a component and have tried hard-coding the value to 80.
<cfargument name="appPort" type="numeric" required="Yes">
Yet, I getting an error as follows:
Could not perform web service invocation "createApplication" because java.lang.IllegalArgumentException: argument type mismatch
Is this a known bug? I have seen other users complaining of the same problem. What is even more strange is that this error is inconsistent (i.e. numeric values don't always produce this error). Yet it is consistently produced with this particular Web Service method.
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
This is in response to the first post which refers to inability to get the raw XML. I have been able to do this quite easily using the code below:
<cfinvoke webservice="http://somewebsite/WebService.asmx?WSDL"
method="GetMethod"
returnvariable="returnVar"/>
<cfset responseArray = returnVar.get_any()>
<cfset firstElementObject = #responseArray[1]#>
<cfset firstElementXML = XMLParse(firstElementObject.toString())>
I have installed the hotfix described at http://www.macromedia.com/support/coldfusion/ts/documents/webservices_header.htm. This may be why the above code works for me. Hope this helps.
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
The username and password come into play if you have used web server security to password protect the directory containing the component. It has nothing to do with ColdFusion authentication (that is, cflogin/cfloginuser specified in application.cfm).
So, username must be defined in whatever user store your web server uses for security (NT domain for IIS, LDAP for iPlanet, for example).
You can find a little more information in the corresponding discussion in the Developing Applications with ColdFusion manual: http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/webser32.htm
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
I'm a bit stumped.
I'm trying to add some security to my CFC web service. I entered a username and password in Administrator for the specific web service entry under Administrator -> Data & Services -> Web Services
I figured that I could then pass the username/password values to the web service via CFINVOKE:
<cfinvoke
webservice = "#myWebService#"
method = "getFunction"
username = "username"
password = "password"
returnVariable = "returnVar">
But the documentation states that those values are to "override (the values) specified in Administrator > Web Services".
What does "override" mean? Does this somehow reset or otherwise ignore the settings in Administrator? That certainly isn't what I'm after. Can I not simply authenticate by passing these values?
LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p67.htm
Correct. CF doesn't provide access to the raw XML.
The CFMX 6.1 Release Notes say :
... includes the ability to specify timeouts and proxy settings, and to invoke over SSL.
[Top]
Recommended Books
COLDFUSION MX Web Application Construction Kit (5th Edition)
Authors: Ben Forta and Nate Weiss
1500 pages
[Top]
Web Sites
Macromedia
The makers of ColdFusion/ColdFusion MX.
ColdFusion Developer's Journal
Forta.com (ColdFusion Section)
Ben Forta is Macromedia's Senior Technical Evangelist. Here on his site find useful ColdFusion information.
Flash CFM
Flash and ColdFusion Development.
Handling file uploads without CFFILE
BLOG post by "Sam" on REWINDLIFE.COM gives insight into how to upload a file on your site if you are not allowed to use the CFFILE tag.
[Top]
Copyright © 2003- 2008, Orville Paul Chomer, All Rights Reserved
Home Page
Blog
How To
Chomer TV
The Show
Webcam Videos
Freeware
•
VB Mahjongg
Coding
•
ColdFusion
•
Javascript
•
Visual Basic
Other Places
Acoustic Eidolon
History Singers
Scobleizer
Beach Walks
Freshtopia
CSS Zen Garden