I'm trying to access Amazon's web service (either AWS 3.0 or ECS 4.0)
through Flash Remoting 2.0 components and PHP/nusoap gateway.
I have simple actionscript code, which successfully calls a web
service through the wsdl file; however, when I use the same code and
try to call one of Amazon's web services, I am unsuccessful.
My question is: what is wrong with my code? I've included below my
code (call to method ItemLookup), related links, and various other,
perhaps pertinent, information.
import mx.remoting.Service;
import mx.remoting.PendingCall;
import mx.rpc.RelayResponder;
import mx.rpc.FaultEvent;
import mx.rpc.ResultEvent;
mx.remoting.debug.NetDebug.initialize();
mx.remoting.debug.NetDebug.trace();
var flashService:Service = new Service(
"http://[website].com/flashservices/gateway.php",
null,
"http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl",
null,
null);
var parameters = new Object();
parameters.Service = "AWSECommerceService";
parameters.SubscriptionId = "[20 digit SubscriptionId]";
parameters.Operation = "ItemLookup";
parameters.ItemId = "0393316041";
var pc:PendingCall = flashService.ItemLookup(parameters);
pc.responder = new RelayResponder(this, "amazonSearch_Result",
"amazonSearch_Fault");
function amazonSearch_Result(re:ResultEvent):Void{
trace (re.result.Items.ProductName);
}
function amazonSearch_Fault(fe:FaultEvent):Void{
trace (fe.fault.faultstring);
}
Link to Amazon's ECS:
http://www.amazon.com/gp/aws/sdk/102-6126594-2444162?v=2005%2d03%2d23&s=AWSEcommerceService
Other Info:
1) there is a gateway.php file on my server in the flashservices directory
2) nusoap files are included in the flashservices\lib directory
3) the web server runs PHP 4.?
4) using Flash MX 2004 Professional and Flash Remoting 2.0
Additionally, this is the error I receive from the NetConnection Debugger:
DebugId: "0"
EventType: "Result"
MovieUrl: "file:///C|/AmazonWCS.swf"
Protocol: "http"
Result: (boolean) false
Source: "Client"
Time: 1121194395922
Date (object #1)
....."Tue Jul 12 14:53:15 GMT-0400 2005"
or
Result (object #2)
.....detail: "The request contains an invalid SOAP body."
.....faultcode: "SOAP-ENV:Client"
.....faultstring: "We encountered an error at our end while processing
your request. Please try again" |