Welcome, Guest. Please login or register.
Did you miss your activation email?
05/21/12, 04:18
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  Web Services: XML, Soap, WSDL, UDDI, and Flash Integration (Moderators: Flash-db, Musicman, vesa kortelainen, Ronald Wernecke, Jorge Solis)
| | |-+  WSDL AS 2 Class
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 3 Print
Author Topic: WSDL AS 2 Class  (Read 23745 times)
Cameron
Server what's that
*
Posts: 28


View Profile WWW
« on: 05/10/06, 22:20 »

Hi

I am just starting to use WSDL and I and trying to use this one http://www.flash-db.com/services/?ID=33&sType=Tools in an AS 2 class but it just won't work, it doesn't show any errors. Any help to fix this or on how to do it properly will be much appreciated  Smiley

Code:
import mx.remoting.*;
import mx.rpc.*;
import mx.utils.Delegate;
import mx.remoting.debug.NetDebug;

class DomainT extends MovieClip
{
//Change the gateway URL as needed
private var gatewayUrl:String = "http://localhost/flashservices/gateway.php";
private var service:Service;
//public var domainname:String;

function DomainT()
{
NetDebug.initialize();
this.service = new Service(this.gatewayUrl, null, "http://services.xmethods.net/soap/urn:xmethods-DomainChecker.wsdl",null,null);
}

function checkDomain(domainname)
{

var pc:PendingCall = service.checkDomain(domainname);
pc.responder = new RelayResponder(this, "handleGetDomain", "handleRemotingError");
}


function handleGetDomain(re:ResultEvent)
{
    trace(re.result)
}

function handleRemotingError( fault:FaultEvent ):Void
{
NetDebug.trace({level:"None", message:"Error: " + fault.fault.faultstring });
}
}
Logged

Save Water
Drink Beer
nothingGrinder
Mods
Systems Administrator
*****
Posts: 823


Automatic websites with social media distribution


View Profile WWW
« Reply #1 on: 05/10/06, 22:33 »

do you have the AMFPHP remoting gateway installed?
Logged

Cameron
Server what's that
*
Posts: 28


View Profile WWW
« Reply #2 on: 05/10/06, 22:45 »

Yes and I intstalled nusoap in \services\lib
Logged

Save Water
Drink Beer
nothingGrinder
Mods
Systems Administrator
*****
Posts: 823


Automatic websites with social media distribution


View Profile WWW
« Reply #3 on: 05/10/06, 23:52 »

i dont think you are sending the service any parameters. you need to send a URL to the service so it can send a return.
Logged

Cameron
Server what's that
*
Posts: 28


View Profile WWW
« Reply #4 on: 05/11/06, 00:02 »

Hi I am using this to test it.

var dnl:DomainT = new DomainT();   
dnl.checkDomain("ispot.co.nz");
Logged

Save Water
Drink Beer
nothingGrinder
Mods
Systems Administrator
*****
Posts: 823


Automatic websites with social media distribution


View Profile WWW
« Reply #5 on: 05/11/06, 03:22 »

well, ive done a lot of testing and i find no problems in your syntax, in fact im having the same trouble as you. I cannot connect to any webservice using remoting.

this code works....

Code:
import mx.services.WebService;
var sWSDLURL:String = "http://services.xmethods.net/soap/urn:xmethods-DomainChecker.wsdl";
var wsExchangeRate:WebService = new WebService(sWSDLURL);
var oCallback:Object = wsExchangeRate.checkDomain("ispot.co.nz");
oCallback.onResult = function(url):Void
{
trace(url);
};
oCallBack.onFault = function():Void
{
trace("an error occured");
}

but this is not a remoting call and therefore much slower.
Logged

nothingGrinder
Mods
Systems Administrator
*****
Posts: 823


Automatic websites with social media distribution


View Profile WWW
« Reply #6 on: 05/11/06, 03:26 »

even when running a log on your service, i get this in the output panel...

Code:
myLogger-->>>5/11 17:24:53 [INFO] logger1: Creating Service for http://services.xmethods.net/soap/urn:xmethods-DomainChecker.wsdl
myLogger-->>>5/11 17:24:53 [INFO] logger1: Creating gateway connection for http://localhost/flashservices/gateway.php
myLogger-->>>5/11 17:24:53 [INFO] logger1: Successfully created Service
myLogger-->>>5/11 17:24:53 [INFO] logger1: Invoking checkDomain on http://services.xmethods.net/soap/urn:xmethods-DomainChecker.wsdl

so it connects to the service, but nothing comes back, so it seems. Im good with AS2.0 syntax and remoting stuff, but im a bit clueless about SOAP and WebServices  so it may be better to wait for one of the moderators. I would like some info on this as well. ill keep searching in the mean time.
Logged

Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #7 on: 05/11/06, 04:28 »

The service seems to be down:

Quote
5/11 11:22:1 [INFO] : Invoking call checkDomain
Error opening URL "http://64.124.140.30:9090/soap"
5/11 11:22:2 [INFO] SOAP: Received SOAP response from network [438 millis]
5/11 11:22:2 [INFO] SOAP: Decoding SOAPCall response
undefined,Unable to connect to endpoint: http://64.124.140.30:9090/soap

Try another similar service looking in xmethods list: http://services.xmethods.net/ve2/Directory.po

Jorge
Logged

nothingGrinder
Mods
Systems Administrator
*****
Posts: 823


Automatic websites with social media distribution


View Profile WWW
« Reply #8 on: 05/11/06, 05:02 »

im not sure thats correct Jorge,
i was able to connect using this code...
Code:
import mx.services.WebService;
var sWSDLURL:String = "http://services.xmethods.net/soap/urn:xmethods-DomainChecker.wsdl";
var wsExchangeRate:WebService = new WebService(sWSDLURL);
var oCallback:Object = wsExchangeRate.checkDomain("ispot.co.nz");
oCallback.onResult = function(url):Void
{
trace(url);
};
oCallBack.onFault = function():Void
{
trace("an error occured");
}

its only when i try to connect through AMFPHP that it doesnt work.
Logged

Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #9 on: 05/11/06, 05:05 »

 Huh
With your code I get unavailable

Are you receiving some result?

Jorge
Logged

nothingGrinder
Mods
Systems Administrator
*****
Posts: 823


Automatic websites with social media distribution


View Profile WWW
« Reply #10 on: 05/11/06, 05:14 »

unavailable is the result,
Code:
This service checks if the submitted domain name is available or not.
 If it is available it will return 'available' if it is unavailable, you guess it, it will return 'unavailable'.

try a domain name that has no owner or host and it should return available. but i get no return at all if i use Remoting
Logged

Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #11 on: 05/11/06, 05:38 »

Ah, ok. So the problem should be when using RelayResponder probably

Jorge
Logged

nothingGrinder
Mods
Systems Administrator
*****
Posts: 823


Automatic websites with social media distribution


View Profile WWW
« Reply #12 on: 05/11/06, 05:48 »

is it possible to use a callback object with a pending call?
Ive tried the tutorial in its orginial form from Flash 8 and it doesnt work.

this tutorial.
www.flash-db.com/services/?ID=33&sType=Tools
doesnt work from Flash 8.
Logged

Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #13 on: 05/11/06, 06:32 »

Probably should be updated

Jorge
Logged

Cameron
Server what's that
*
Posts: 28


View Profile WWW
« Reply #14 on: 05/11/06, 19:59 »

Hi I have got it working using webservices but it always returns unavailable even when they are available. Is there a problem with the code or is the service broken?

Code:
var dnl:doTest = new doTest();
dnl.ext = new Array(".co.nz",".com",".biz");
dnl.chec("i-wear-direct");
Code:
import mx.services.WebService;

class doTest {

private var sWSDLURL:String = "http://services.xmethods.net/soap/urn:xmethods-DomainChecker.wsdl";
private var wsExchangeRate:WebService;
private var oCallback:Object;
public var domainname:String;
public var dname:String;
public var ext:Array;

function doTest(){
this.wsExchangeRate = new WebService(sWSDLURL);
}

function chec (domain:String){
dname = domain;
for(var key in ext){
domainname = dname + ext[key];
this.oCallback = wsExchangeRate.checkDomain(domainname);
oCallback.resp = {domainname:domainname};
oCallback.onResult = onResult;
oCallback.onFault = onFault;
}

}

function onResult(res){
trace(res + "---" + this["resp"].domainname);
}

function onFault(fault){
trace(fault.faultCode + "," + fault.faultstring);
}
}
Logged

Save Water
Drink Beer
Pages: [1] 2 3 Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!