To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > PHP Help > General Help

General Help Forum for General Help questions pertaining to PHP

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 08-15-2008, 02:01 PM   #1
SeenGee
Senior Member
 
Join Date: Apr 2003
Location: England
Posts: 228
web services using WS-Security

Hi all,

I have been asked to integrate an ecommerce site with a fulfillment house that uses a web services using WS-Security for passing all order information and retrieving response. I have worked with a number of XML api's, all using REST and none using any kind of security so i'm a bit out of my comfort zone. I have been instructed that to access it i will need to use a proxy but it seems to be using proxy in a different context to one i'm used to and all code fragments are ASP.net which i know nothing about.

This is the developer information for what i need to connect to: http://ittd.twoten.com/v3/iDataInfo/...ngClients.aspx

I have found some php that talks bout proxies with web services and offers this as a fragment:
PHP Code:
$wsdlUrl = 'file.wsdl';
$proxy = new SoapClient($wsdlUrl);
I'm not sure if this is what i really need though, i have also found this http://wso2.org/library/2814 which also looks relevant which requires a package install via pecl

I have been provided a .pfx , a .cer and a .p7b file as part of the integration kit provided and my system is CentOS 4.6 running php 5.2

All in all i'm a bit confused here and would really appreciate any pointers / advice.

Thanks.

Last edited by SeenGee; 08-15-2008 at 02:10 PM.
SeenGee is offline   Reply With Quote
Old 08-16-2008, 05:48 PM   #2
sneakyimp
Senior Member
 
Join Date: Apr 2003
Location: LA
Posts: 3,720
I'm pretty sure WSO2 would help you do what you want to do. They have a bunch of sample code in the scripts that come with the install. I'm not at all sure what you do with the pfx and p7b files but I do know that the WSF/PHP stuff from WSO2 will let you contact a web services XML page and instantiate a proxy object which lets you make function calls to the gateway.

It also supports WS security tokens and SSL.

Beyond that, I don't know a lot about it. I would recommend installing WSF/PHP on your server and looking into some of the example code. WSO2 is also pretty responsive when you post questions on their forum. There are some smart folks over there.

Some code I implented that uses it looks like this:
PHP Code:
$policy = new WSPolicy(array(
    
"security" => array(
        
"useUsernameToken" => TRUE,
        
"includeTimeStamp" => TRUE
    
)
));

$securityToken = new WSSecurityToken(array(
    
"user" => "sneakyimp",
    
"password" => "foobar",
    
"passwordType" => "Digest",
    
"ttl" => 300
));

$client = new WSClient(array(
    
"wsdl"=> 'somefile.xml',
    
"useWSA" => TRUE,
    
"policy" => $policy,
    
"securityToken" => $securityToken,
    
"timeout" => 60
));

$proxy = $client->getProxy();

/* create request obj */
$request = array(
    
'arg1' => $myarg1,
    
'arg2' => $myarg2
);        


$returnValue = $proxy->bulkImport(array(
    
"request" => $request,
    
"param2" => $param2,
    
"param3" => $param3
));
__________________
Write multiplayer games in AS3/PHP5 with FlashMOG 0.3.1
Find out your worth with the MyPlan Salary Calculator
sneakyimp is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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


All times are GMT -4. The time now is 11:02 PM.








Acceptable Use Policy

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.