Welcome to the Freeway Forums

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to Register before you can post: click the Register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.


   Freeway Forum Index -> Webservices  
View previous topic :: View next topic  
 
Web Services Documentation?
 
Jon Diamond

Posted: 22.04.2008
Group:
Score: 0
User's points: 0
Hi I just downloaded freeway today and I'm tearing through all the info I can find but I can't seem to find anything about using the web services? I tried to connect to my server:

http://localhost/apps/e-commerse/freeway/soap/subscription.wsdl

freeway is installed in /apps/e-commerse/ (I know that is a typo I wouldn't be a good programmer if I wasn't to lazy to fix it... )

So please if anyone point me towards some freeway wsdl info I would appreciate it.[color=violet]
[/color]
 
Damian Hickey

Posted: 26.04.2008
Group:
Score: 0
User's points: 181
Hi,

We'll doc that this week in a HowTo. Now we have the twiki, we are getting more flexible. During the week. We will put up some guidelines about contributing as well.

Cheers,

Damo
_________________
ZacWare, Level 1 iLab, 80 Jephson Street, Toowong 4066, Queensland, Australia

There is at least one elegant solution to every real problem.
 
Jon Diamond

Posted: 26.04.2008
Group:
Score: 0
User's points: 0
Well I Decided to make a quick way to get a connection going...

Below is the relevant code with some comments; The basic idea is you create a class in a file of the same name with the prefix ws_. So if you made a payment class called Payment you would place it in a file called ws_Payment.php. the Class Payment will contain all the functions you want to use the file can contain any other code etc... etc..

after you create the class and save it in the correct location you will point your SOAP client to the url of the web service .../index.php?service=Payment

The WSDL is auto generated when you connect from a client as well as the server.

other then the files outlined below you will need to get WSDLCreator. I did not write this code but the author has a web site and has released it for free under GNU lesser GPL. WSDLCreator consists of 3 files you will need to create a free account with PHPClasses to download it or you can PM me your e-mail address and I will e-mail it to you. http://www.protung.ro/

ws_init.php --------
//Set the Server up for dealing with XML and wsdl
ini_set("soap.wsdl_cache_enabled", "0");
header('Content-Type: text/xml; charset=UTF-8');

//Require configuration for outside enviornment
//This is not needed for the web service but your classes will need it so may as well include it here...
require('/freeway/admin/includes/configure.php');
//Require Class used to generate WSDL document


//Set Variables used as constants through out the web services system
$ws_request = 'service'; //-------> Used to coordinate the param passed throughout the ws system
$ws_host = 'http://localhost';
$ws_server = 'server.php';
$ws_wsdl = 'index.php';
$oe_includes_path = '/freeway/includes/';
$oe_admin_path = '/freeway/admin/includes/';
$oe_fun_path = '/freeway/admin/includes/functions/';
$load = isset($_REQUEST[$ws_request]) ? $_REQUEST[$ws_request] : 'default';
if($load != 'default'){
$load_class_file = 'ws_'.$load.'.php'; //-------> File contianing the class definition for requested service
$ws_path_sys = '/freeway/custom/webservices/'; //----> System Path
$ws_path_url = '/freeway/custom/webservices/'; //------------> URI Path
//Require the file containing the class definition of the requested service
require($ws_path_sys.$load_class_file);
}
end ws_init.php ---------

index.php ----------------
require('ws_init.php');
require('WSDLCreator.php');

if(is_file($load_class_file)){
$display = new WSDLCreator($load,$ws_path_url.$ws_wsdl.'?'.$ws_request.'='.$load);
$display->addFile($ws_path_sys.$load_class_file);
$display->addURLToClass($load, $ws_host.$ws_path_url.$ws_server.'?'.$ws_request.'='.$load);
$display->createWSDL();
$display->printWSDL();
}
else{
echo "You are not Authorized to View this Page";
}
end index.php ----------------

server.php --------------------
require('ws_init.php');

// Create the server
$server= new SoapServer($ws_host.$ws_path_url.$ws_wsdl.'?'.$ws_request.'='.$load, array('soap_version' => SOAP_1_2, 'encoding' => 'UTF-8', 'classmap' => $classmap));
$server->setClass($load); //-----> Add the requested Class functions to the Soap Server
$server->handle(); //--------------> Do it!

end server.php -----------------------------------

Make sure you read through the readme and examples in WSDLCreator here is an example class that demonstrates how to get an array back from your SOAP service:

class getData{
/**
* @return mixed
* */
function returnAll(){
$myvar = array("one", "two", "Three");
return $myvar;
}
}

!!!!! Take not that Comment is required for the WSDL Creator to work!!!!!
Php is loosely typed XML is not.
 
mick

Posted: 06.06.2008
Group:
Score: 0
User's points: 0
Damian Hickey wrote:
We'll doc that this week in a HowTo. Now we have the twiki, we are getting more flexible. During the week. We will put up some guidelines about contributing as well.


Well I've looked for this How-To on the Documentation page and don't see it. I'm desperately looking for guidance on how to plug in to Freeway's web services... documentation anyone?

Regards,

Mick
 
Damian Hickey

Posted: 06.06.2008
Group:
Score: 0
User's points: 181
Sorry,

We will get this completed in the next few days. Sorry to overlook it.

Damo
_________________
ZacWare, Level 1 iLab, 80 Jephson Street, Toowong 4066, Queensland, Australia

There is at least one elegant solution to every real problem.
 
mick

Posted: 06.06.2008
Group:
Score: 0
User's points: 0
Thanks! I look forward to it!

Regards,

Mick
Display posts from previous:   
   Freeway Forum Index -> Webservices All times are GMT + 10 Hours
Page 1 of 1
 Jump to:   

What is going on
Our users have posted a total of 6616 articles
We have 1492 registered users
The newest registered user is FenuebemCange
In total there are 0 users online :: 0 Registered, 0 Hidden and 0 Guests   [ Administrator ]   [ Moderator ]
Most users ever online was 176 on 03.05.2008
Users browsing this forum: None
This data is based on users active over the past five minutes

Legend
 New posts     No new posts    Announcement
New posts [ Locked ]   No new posts [ Locked ]   Sticky
New posts [ Popular ]   No new posts [ Popular ]      
New posts perfect answer    No new posts perfect answer

 
 Jump to:   
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Top Members

Member Icons
  • Wizard (2500 points)
  • Guru (1000 points)
  • Pro (500 points)
  • Graduate (250 points)
How to earn points