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

Could not generate stub objects for web service invocation in ColdFusion

New Here ,
Jul 02, 2011 Jul 02, 2011

Copy link to clipboard

Copied

I was able to call the services on the development box - windows server without any problem at all, everything was working fine but the moment i uploaded to a linux box production server I get this error. "Could not generate stub objects for web service invocation in ColdFusion"

What could be the cause of this problem, i have googled a lot but no solution yet any ideas.

Views

6.5K

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 ,
Jul 02, 2011 Jul 02, 2011

Copy link to clipboard

Copied

Is it a case-sensitivity issue?  If you have /path/to/MyComponent.cfc, you need to always refer to it as path.to.MyComponent. "mycomponent" will work on Windows, but it will not work on case-sensitive file systems.

--

Adam

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
New Here ,
Jul 02, 2011 Jul 02, 2011

Copy link to clipboard

Copied

Thanks for your response, I have checked the case sensitive issue, the url is in the required case. The entire error is:

Cannot generate stub objects for web service invocation.

Name: https://******/TransactionQueryWs.asmx?wsdl. WSDL: https://*********/TransactionQueryWs.asmx?wsdl. java.io.FileNotFoundException: /opt/coldfusion8/stubs/WS334836208/org/tempuri/TransactionQueryWSSoap.java (No such file or directory) It is recommended that you use a web browser to retrieve and examine the requested WSDL document to ensure it is correct. If the requested WSDL document cannot be retrieved or is dynamically generated, it is likely that the target web service has programming errors.

**Note i have used asterix to max the original url, i used a complete url

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 ,
Jul 02, 2011 Jul 02, 2011

Copy link to clipboard

Copied

Aah... I've had this before years ago on a Solaris system.  And I can't - for the life of me - remember what caused it.

Basically the CFC file is failing to be compiled at all, for some reason... that's why there's a reference to a .java file rather than a .cfm file.

I wonder was it because we had some UTF-8-encoded characters in the CFC file and had not put the appropriate CFPROCESSINGDIRECTIVE tag in it?

I'll have a look around to see if I can find anything about this...

In the mean time, can you browse directly to the CFC and successfully get:

a) its autogenerated docs (so just browse straight to the CFC);

b) its WSDL (browse to it, but with ?wsdl on the URL too).

--

Adam

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 ,
Jul 02, 2011 Jul 02, 2011

Copy link to clipboard

Copied

I remembered what it was, just after pressing SEND.

Do you have a DISPLAYNAME or a NAME attribute on the CFCOMPONENT tag?  It was one of those that caused the compilation to fail for us (NAME is not even a valid attribute for a CFCOMPONENT tag, but some people still put one on, for some reason).

--

Adam

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
New Here ,
Jul 02, 2011 Jul 02, 2011

Copy link to clipboard

Copied

Thanks once again, I'm not using cfc at all, the webservices i'm calling is a .net stuff, and I can call it from the windows server, it works well until we uploaded the code to a linux server which is the production server and all hell broke loose.

The code below work just fine on the windows box, please kindly check below:

<cfinvoke webservice="https://********/TransactionQueryWs.asmx?wsdl" method="getData" returnvariable="getDataResult">

    <cfinvokeargument name="product_id" value="21" />

    <cfinvokeargument name="trans_ref" value="0000066667777" />

</cfinvoke>

<cfdump var="#getDataResult#" />

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 ,
Jul 02, 2011 Jul 02, 2011

Copy link to clipboard

Copied

OK, so just to confirm... the .net web service is on some other server?  You are not expecting to be able to call .dot code from a Linux machine, right?

So the CFM calling code is on this Linux box, and the .net web service code is on some other Windows box?

Can the Linux box see the Windows box?  IE: can you do a WGET (or similar) on the Linux box and get the WSDL of that web service OK?

--

Adam

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
New Here ,
Jul 02, 2011 Jul 02, 2011

Copy link to clipboard

Copied

Let me make it simple:

1. Server A is our development server.- hosted inhouse with coldfusion installed.

2. Server B is our production server - a linux server with coldfusion installed hosted on the internet

3. Server C is a third party server containing the webservice - this is a windows server with .net

coldfusion is installed on Server A, the code works here and can connect to server C without any problem. It gets the required respone

but when the code was uploaded to server c it gives the error when we run it.

now i tried just a simple code which works fine on server A below:

<cfinvoke webservice="http://www.webservicex.net/CurrencyConvertor.asmx?WSDL" method="ConversionRate" returnvariable="ConversionRateResult">

    <cfinvokeargument name="FromCurrency" value="EUR" />

    <cfinvokeargument name="ToCurrency" value="USD" />

</cfinvoke>

<cfdump var="#ConversionRateResult#" />

But when i uploaded it to server C: it returns the error

Cannot generate stub objects for web service invocation.

Name: http://www.webservicex.net/CurrencyConvertor.asmx?WSDL. WSDL: http://www.webservicex.net/CurrencyConvertor.asmx?WSDL. java.io.FileNotFoundException: /opt/coldfusion8/stubs/WS728929035/NET/webserviceX/www/Currency.java (No such file or directory) It is recommended that you use a web browser to retrieve and examine the requested WSDL document to ensure it is correct. If the requested WSDL document cannot be retrieved or is dynamically generated, it is likely that the target web service has programming errors.
The error occurred in /home/works/public_html/currency.cfm: line 7
5 :     <cfinvokeargument name="FromCurrency" value="EUR" />
6 : 
7 :     <cfinvokeargument name="ToCurrency" value="USD" />
8 : 
9 : </cfinvoke>

Now if you try the preceeding code on a windows environment  it works fine but the moment you put in the in the linux environment it generates this error

I feel that the error may actually be :

java.io.FileNotFoundException: /opt/coldfusion8/stubs/WS728929035/NET/webserviceX/www/Currency.java (No such file or directory)

but i am clueless as to what to do next

Ok so I tried the wget command on the linux

this is what i got

-bash-3.2# wget http://www.webservicesx.net/CurrencyConvertor.asmx?WDSL

--2011-07-02 23:23:42--  http://www.webservicesx.net/CurrencyConvertor.asmx?WDSL

Resolving www.webservicesx.net... 216.8.179.25

Connecting to www.webservicesx.net|216.8.179.25|:80... connected.

HTTP request sent, awaiting response... 403 Forbidden

2011-07-02 23:23:43 ERROR 403: Forbidden.

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 ,
Jul 02, 2011 Jul 02, 2011

Copy link to clipboard

Copied

Cool, that clarifies things.

The thing to do next is confirm what I asked about whether server B can actually reach server C.  From the command line of the Linux box, do a wget of the URL to the web service.  Do you get the WSDL back?  (or if you have a GUI running on the box, just use a web browser ;-).

Also: what happens if you make the call via CFHTTP instead of CFINVOKE?

When CF calls a remote web service, it creates a stub class locally on the CF server which one's CF code calls, rather than making the remote call every time.  It's basically a proxy or a bridge to the remote service.  And it's that step that's failing: it's not managing to create that file.  I don't know why that would be.

--

Adam

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
New Here ,
Jul 02, 2011 Jul 02, 2011

Copy link to clipboard

Copied

Using wget on the initial code  I got this:

Resolving ****.com... ***.

Connecting to *****.com|*****|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 6031 (5.9K) [text/html]

Saving to: `TransactionQueryWs.asmx'

so it can connect to it very well

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
New Here ,
Jul 03, 2011 Jul 03, 2011

Copy link to clipboard

Copied

I finally solved the problem, sometimes a complex situation requires a simple solution. IThe problem is due to CF inability to create the directories needed due to the restrictions on the server, so what i did was to create the directories /opt/coldfusion8/stubs/WS334836208/org/tempuri/ on the server. Then i went to the windows server and located the java files in this location, i copied it to the linux server and set the directory permissions. Immediately the code was running.

It took tons of hours to get to this but i'm glad i got it working finally.

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 ,
Jul 04, 2011 Jul 04, 2011

Copy link to clipboard

Copied

The problem is due to CF inability to create the directories needed due to the restrictions on the server

Heh.  it would have taken me a while to suggest looking at that!

The user CF runs as should have write permission to its directory.  There are a few places CF needs to write to file in there (over and above the one you just found).

--

Adam

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
Community Beginner ,
Dec 04, 2019 Dec 04, 2019

Copy link to clipboard

Copied

I can´t do it. I'm on CF 11, and the WS just send the Response Structure. Some idea?

 

http://wspruebas.rfacil.com/InterconectaWs.svc?wsdl

Thank You in advance.

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
Community Expert ,
Dec 04, 2019 Dec 04, 2019

Copy link to clipboard

Copied

You can't do "what"? You dropped this comment into an 8-year old thread. Are you perhaps saying you get the same error in the subject here? If so, again what is it that you "can't do"?

 

I browsed that WSDL and got a reply, and so CF would be able to as well. If you're getting some other problem, what is the problem?


/Charlie (troubleshooter, carehart.org)

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
Community Beginner ,
Dec 04, 2019 Dec 04, 2019

Copy link to clipboard

Copied

Hello.

Thank You for your time.

I can get only the description of the response, not the response.


webservice="http://wspruebas.rfacil.com/InterconectaWs.svc?wsdl"
method="ConsultaLRFC"
returnvariable="REQUEST.Compliment">



/>






[image: image.png]

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
Community Expert ,
Dec 06, 2019 Dec 06, 2019

Copy link to clipboard

Copied

Unfortunately, your attempt to share code is failing here in these new community forums. Even your second attempt below still failed.

 

Note that when entering a reply, there are tool icons that appear at the top of the input box (at least in the web-based version of the site) , and  one of those shows a pair of brackets. Click that to enter code, which would appear then as this:

 

<cfoutput>this is a code sample</cfoutput>

Then we can better assess what's amiss about why you "can get only the description of the response, not the response." 


/Charlie (troubleshooter, carehart.org)

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
Community Beginner ,
Dec 06, 2019 Dec 06, 2019

Copy link to clipboard

Copied

 

I'm trying This:

 

<cfscript> 
 ws = createObject("webservice", "http://timbrado.pade.mx:80/servicio/herramientas?wsdl"); 
 xlatstring = ws.ConsultaRfc("consultarRfc=RIMF701004EI8"); 
 </cfscript> 

 

 

And This:

 

 

 <cfsavecontent variable="LlamadaSoap">
    <cfoutput>
		<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
			<soapenv:Header/>
			<soapenv:Body>
				<rfc:consultarRfc>
					<contrato>XXX</contrato>
					<usuario>YYY</usuario>
                    <passwd>ZZZ</passwd>
                    <rfcObject>RIMF701004EI8</rfcObject>                    
				</rfc:consultarRfc>
			</soapenv:Body>
		</soapenv:Envelope>
	</cfoutput>
</cfsavecontent>

    
<cfhttp url="https://beta.ws.insigna.mx/services" method="post" result="Algo">
    <cfhttpparam type="header" name="content-type" value="text/xml">
    <cfhttpparam type="header" name="SOAPAction" value="">
    <cfhttpparam type="header" name="content-length" value="#len(LlamadaSoap)#">
    <cfhttpparam type="header" name="charset" value="utf-8">
	<cfhttpparam name="SOAPAction" type="header" value="http://rfc.ws.pade.prodigia.mx/ConsultaRfc/"/>
    <cfhttpparam type="xml" name="message" value="#Trim(LlamadaSoap)#">
</cfhttp>

 

 

And the result is the same:

 

Cannot generate stub objects for web service invocation.
Name: http://timbrado.pade.mx:80/servicio/herramientas. WSDL: http://timbrado.pade.mx:80/servicio/herramientas. javax.wsdl.WSDLException: WSDLException (at /html): faultCode=INVALID_WSDL: Expected element '{http://schemas.xmlsoap.org/wsdl/}definitions'. It is recommended that you use a web browser to retrieve and examine the requested WSDL document to ensure it is correct. If the requested WSDL document cannot be retrieved or is dynamically generated, it is likely that the target web service has programming errors.
 
The error occurred in D:/Software/Apache/wamp/www/NSN/Timbrado/Timbrado.cfm: line 7
5 : 
6 : <cfscript> 
7 :  ws = createObject("webservice", "http://timbrado.pade.mx:80/servicio/herramientas"); 
8 :  xlatstring = ws.ConsultaRfc("consultarRfc=RIMF701004EI8"); 
9 :  </cfscript> 

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
Community Expert ,
Dec 06, 2019 Dec 06, 2019

Copy link to clipboard

Copied

Francisco, your first problem is that you left off the ?wsdl in the createobject call. Yes, you show it in the code you posted, but the error shown clearly indicates that on line 7 of your cfm page, you did not include it. That's the cause of that error.

 

Even then, the next error you'd get (once you fixed that) is because the argument you are providing is not valid for the method (consultarfc). I know because I tried it (on trycf.com, where one can run any CFML, on either CF or Lucee.) And not only did I get an error, but you can see this for yourself that this is not a valid argument for the consultarcfc method you are calling.

 

First, if you do a dump of the resulting ws variable  (with writedump in that cfscript fragment), you will see all the methods of the web service, and their expected arguments. And you will see that consultarfc does not expect one but four arguments (and none is named consultarfc, as you are naming what's passed within the parentheses).

 

Second, you can also see this (and even more easily experiment with values) if you visit the wsdl using an online tool for browsing web services, like soapclient.com. Here is a link for your wsdl url. Again, you can clearly see the methods and arguments.

 

I gather you might be new to either using web services with CFML or perhaps also CFML itself (if someone has maybe tasked you to get this working). I have given you here all you really should need to get things going. If you do have follow-up, that would no longer be about the error covered by this thread ("could not generate stub objects"), then you really ought to create a new forum thread. The previous people in this thread (since 2011) may not appreciate getting emailed about this ongoing discussion.

 

Finally, I want to make an observation about what you have shared here in your replies.

 

In your first post in the thread, you referred to trying to get to this wsdl: http://wspruebas.rfacil.com/InterconectaWs.svc?wsdl. And then in your one that had formatting trouble, you showed trying to call that via what was clearly a CFINVOKE (as we can see the atteributes you were using, even if we couldn't see the tag). Yet now in this last reply (properly formatted), the formatted code shows you calling it via createobject (which is ok, but why the change?).

 

More important, this last reply shows you calling a DIFFERENT web service URL, as:

 

ws = createObject("webservice", "http://timbrado.pade.mx:80/servicio/herramientas?wsdl");

 

 

Again, I guess it's ok, but it's confusing matters that you're so inconsistent.

 

Finally, you go on to show in your last reply that you go on to do yet some other web service call, this time using CFHTTP and that goes to yet ANOTHER web service, https://beta.ws.insigna.mx/services. Let's hold off even considering that until you get past this first set of code.

 

Hope that's helpful.


/Charlie (troubleshooter, carehart.org)

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
Community Beginner ,
Dec 09, 2019 Dec 09, 2019

Copy link to clipboard

Copied

Great.

 

THANK YOU.

 

Now I need to put this response in a string, outside of the cfscript.

 

How can i do it?

 

Sorry, it's my 1st experience with Web Services and ColdFusion.

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
Community Expert ,
Dec 09, 2019 Dec 09, 2019

Copy link to clipboard

Copied

First, as for how to get the string as you want it, it could be helpful if you changed the writedump to not do format "text" (leaving it as the default of html), so that you'd see more readily in the dump what the kind object it is was.

 

As for what you DO show, it seems that the returned object (in that variable you are dumping) is itself a complex object with methods you then need to call. 

 

As for the difference between the current dump in CF and that in Lucee, and the fact that you see some of the "string" you want to "extract", I think it's that Lucee is going ahead and calling those methods (assuming it can, with no arguments), and if it has a result it's showing you. That's a convenience, but not any indication that CF is doing something wrong. Indeed, the screenshot of Lucee does not show WHAT the method names are, but the CF one does. (So each has its value, that the other does not.)

 

And so it looks (from the dumps of each engine) that the method you want is perhaps the geterrormessage, so do this:

 

writedump(xlatstring.geterrormessage());

 

Again, no need of the format argument. Does it have what you want? If so, then you don't need the writedump any more. You could assign that method call to a variable and do what you will with it (show it on the page, send it in an email, store it in a database). Same for the other methods. Just do a dump of each method.

 

And I will remind you as I did early on that if you were to visit this web service using a generic web service browsing tool like soapclient.com, you would have had all these answers without writing a line of CFML.

 

Finally, as for us trying to help you with such issues, it would have been very helpful if you would have also provided a link to the trycf snippet that you created and show below. I could have readily tested things out and confirmed that that method or other methods provided useful string results. As it is, I have to guess. And the values in the args you pass TO the consultarfc are just a bit too complex to easily type.

 

Let us know if this gets you going.


/Charlie (troubleshooter, carehart.org)

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
Community Beginner ,
Dec 09, 2019 Dec 09, 2019

Copy link to clipboard

Copied

 

You are my new hero.

 

It's working GREAT.

 

THANK YOU SO MUCH.

 

 

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
Community Beginner ,
Dec 09, 2019 Dec 09, 2019

Copy link to clipboard

Copied

Here we go Again..!!!

The same exercise, with other provider:

 

I have this with Lucee 5..!!

 

WSResponse2.png

 

But this With CF11..!!

 

WSResponse.png

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
Community Expert ,
Dec 09, 2019 Dec 09, 2019

Copy link to clipboard

Copied

Well, first, are you experiencing that only on the trycf.com site? or also on your own server? Things could act differently on your own server.

 

If you did get it in both servers, then again please share with us a URL to see that same code running either in trycf (where you have to set things up to "save" gists) or in the cffiddle.org (where you have to login to be able to save the url of a set of code)? 

 

Or share the code here, using the "code" button in the UI for editing replies, so that we can see the code, like this:

<cfset name="bob">

/Charlie (troubleshooter, carehart.org)

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
Community Beginner ,
Dec 09, 2019 Dec 09, 2019

Copy link to clipboard

Copied

LATEST

The 2 responses in my last post are in cftry.com

the 1rst with the Lucee 5 Option And the 2nd with the ColdFusion 11 option.

The response in my test server is the same of cftry.com with Coldfusion 11 option (error).

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
Community Beginner ,
Dec 09, 2019 Dec 09, 2019

Copy link to clipboard

Copied

WSResponse.png

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