Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-15-2007, 12:38 AM   #1
jdivis
Registered User
 
Join Date: Oct 2005
Posts: 3
Default Java WebService creation results in Error opening URL

I am following along with some example code from Object-Oriented Actionscript for Flash 8 (pg 465). Example code that works:
Code:
import mx.services.WebService;
import mx.services.PendingCall;

var WS_URL:String = "http://weblogs.macromedia.com/mxna/webservices/mxna2.cfc?wsdl";
var mxna_ws:WebService = new WebService(this.WS_URL);
var categories_pc:PendingCall = this.mxna_ws.getCategories();
this.categories_pc.onResult = function(result_obj:Object):Void {
trace(result_obj);
}
But when I try to use the code above to create and call a Java WebService, the call fails with Error opening URL.

Code:
import mx.services.WebService;
import mx.services.PendingCall;

var WS_URL:String = "http://www.calcxml.com/services/RetirementWS?wsdl";
var ret09Params:String = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><calcxmlRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://www.calcxml.com/schema/calcxmlRequest.xsd\" username=\"guest\" password=\"guest\" responseType=\"both\" version=\"1.1\"><xyChart><chartTitle>Chart Title</chartTitle><threeD>1</threeD><barColor>6D9D6D</barColor><barColor>CD3B3B</barColor><barColor>8C93A5</barColor><chartWidth>400</chartWidth><chartHeight>300</chartHeight></xyChart><dataTable><cssClassName>simpletable</cssClassName></dataTable><calcInput includeInResponse=\"true\"><det03><loanAmount>5000</loanAmount><interestRate>0.05</interestRate><termMonths>60</termMonths><amortization>1</amortization></det03></calcInput></calcxmlRequest>";
var calcXML_ws:WebService = new WebService(this.WS_URL);
var ret09_pc:PendingCall = this.calcXML_ws.ret09(ret09Params);
this.ret09_pc.onResult = function(result_obj:Object):Void {
trace(result_obj);
}
One thing that I've noticed with all other webservice examples, is that the wsdl URL ends with file.ext?wsdl, for cfc?wsdl and aspx?wsdl web service calls. Could it be that Java Web Services and actionscript don't play nice together?

When running the fla file that contains the 2nd example code above, I get the exact error:

Error opening URL "http://www.calcxml.com/services/RetirementWS"

Please note that the error contains a URL similar to the URL passed as the parameter for the wsdl URL, minus the ?wsdl.

Thanks in advance for help.

keywords webservice "web service" "java webservice" "java web service" jsp
jdivis is offline   Reply With Quote
Old 07-15-2007, 01:04 AM   #2
inhan
it's all about patience
 
inhan's Avatar
 
Join Date: Jun 2005
Location: istanbul
Posts: 6,696
Default

In the first time I tried I got the same error. Then I never got that again. But now I'm getting another error in the onFault event handler:

ActionScript Code:
this.ret09_pc.onFault = function(fault) {     trace("error!");     trace(fault.faultstring); };

traces

error!
Element impl:ret09Response not resolvable
__________________
Ali Inhan
Turkish graphic and web designer
an Apple fan
www.aliinhan.com
inhan is offline   Reply With Quote
Old 07-15-2007, 03:43 PM   #3
jdivis
Registered User
 
Join Date: Oct 2005
Posts: 3
Default

When I add your onFault code, I get:


Quote:
Error opening URL "http://www.calcxml.com/services/RetirementWS"
Error!
Unable to connect to endpoint: http://www.calcxml.com/services/RetirementWS
But your traces has helped me. Thank you!

I was not using the correct webservice for the input I was providing. I was providing input for a call to the det03 web service, but providing that input to the ret09 web service... Strange that we don't get the same errors though.

Thanks again for your help Ali.
jdivis is offline   Reply With Quote
Old 07-15-2007, 11:56 PM   #4
inhan
it's all about patience
 
inhan's Avatar
 
Join Date: Jun 2005
Location: istanbul
Posts: 6,696
Default

Strange. Hope you can find a workaround though.
__________________
Ali Inhan
Turkish graphic and web designer
an Apple fan
www.aliinhan.com
inhan is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tracing webservice results you_rock ActionScript 2.0 2 11-15-2003 11:34 AM


All times are GMT. The time now is 06:44 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.