Http Authentication for SOPA Messages in PHP - 2 Minutes Introduction
Thursday, September 25, 2008
But if you want to do Http Basic Authentication you can still use WSF/PHP as your client. Here is a blog How you send Basic Authentication information with your SOAP message in PHP. Note that here authentication is handled in trasport layer. So this approach is only valid if you are using HTTP transport which is the most common transport to use in web services.
Authenticate using Username Token from PHP - 2 Minutes Introduction
Tuesday, September 23, 2008
The blog "Authenticate using Username Token from PHP - 2 Minutes Introduction" give you quick tutorial how you can implement this in PHP using WSF/PHP.
Http Basic Authentication in WSF/PHP
Monday, June 9, 2008
Here is how you are going to do it with WSF/PHP. I will take simple echo sample to demonstrate this,
server side:
You have to configure apache to do the authentication, so the php and wsf/php applications which are running behind the apache server also get authenticated. The following guide will help you to do the configuration very easily,
http://apache.active-venture.com/auth-basic.html
Your server side code is same as the code for a regular service
<?php
function echoFunction($inMessage) {
$outMessage = new WSMessage($inMessage->str);
return $outMessage;
}
$operations = array("echoString" => "echoFunction");
$service = new WSService(array("operations" => $operations));
$service->reply($requestPayloadString);
?>
client side:
<?
$requestPayloadString = <<<XML
<ns1:echoString xmlns:ns1="http://php.axis2.org/samples"><text>Hello World!</text></ns1:echoString>
XML;
try {
$client = new WSClient(array( "to" => "http://localhost/samples/echo_service.php",
"httpAuthUsername" => "xxx",
"httpAuthPassword" => "x@x",
"httpAuthType" => "Basic",
));
$responseMessage = $client->request( $requestPayloadString );
printf("Response = %s
", htmlspecialchars($responseMessage->str));
} catch (Exception $e) {
if ($e instanceof WSFault) {
printf("Soap Fault: %s\n", $e->Reason);
} else {
printf("Message = %s\n",$e->getMessage());
}
}
?>
You will fill the fields specific to http authentication. And here you have web service client and service which uses http basic authentication.
NEW WSClient option for the 1.3.0
Friday, June 6, 2008
Here are the WSClient options you will found in 1.3.* that was not there in earlier releases.
"httpAuthUsername" - Http basic/digest authentication was added in this release, here is where you give the username to authenticate
"httpAuthPassword" - Password for Http authentication
"httpAuthType" - What type of authentication is used. The possible values are "Basic" or "Digest"
"proxyAuthUsername" - Similar to http authentication, proxy authentication too added.
"proxyAuthPassword" - Password for Proxy authentication
"proxyAuthType" - Declare whether the authentication type used is "Basic" or "Digest"
"useMTOM" - This option was already there, but possible values were only TRUE/FALSE. With this release you can give another value to this option, i.e. "swa". You can enable SOAP with Attachement with setting "useMTOM" => "swa"
For more information look at the documentation http://wso2.org/project/wsf/php/1.3.2/docs/api.html
WSO2 Web Services Framework for PHP v1.3.2 Released
Thursday, June 5, 2008
Please try out the new release.
WSO2 Web Services Framework for PHP v1.3.2 Released
We are pleased to announce the release of WSO2 WSF/PHP 1.3.2.
WSO2 Web Services Framework for PHP (WSO2 WSF/PHP), is an open source,enterprise grade, PHP extension for providing and consuming Web Services in PHP. WSO2 WSF/PHP is a complete solution for building and deploying Web services and is the only PHP extension with the widest range of WS-* specification implementations. It's Key features include, secure services and clients with WS-Security support, binary attachments with MTOM, automatic WSDL generation (code first model),
WSDL mode for both services and clients (contract first model) and interoperability with .NET and J2EE.
Project home page: http://wso2.org/projects/wsf/php
Key Features
- Client API to consume Web services
- WSMessage class to handle message level options
- WSClient class with both one way and two way service invocation support
- Option of using functions in place of object oriented API with ws_request
- Service API to provide Web services
- WSMessage class to handle message level options
- WSService class with support for both one way and two way operations
- Option of using functions in place of object oriented API with ws_reply
- Attachments with MTOM
- Binary optimized
- Non-optimized (Base64 binary)
- WS-Addressing
- Version 1.0
- Submission
- WS-Security
- UsernameToken and Timestamp
- Encryption
- Signing
- WS-SecurityPolicy based configuration
- WS-Reliable Messaging
- Single channel two way reliable messaging
- WSDL Generation for Server Side
- WSDL generation based on annotations and function signatures, and
serving on ?wsdl or ?wsdl2 requests
- WSDL generation based on annotations and function signatures, and
- WSDL mode support for both client and server side
- Write services and client based on a given WSDL
- WS-Addressing and WS-SecurityPolicy is supported in WSDL mode
- REST Support
- Expose a single service script both as SOAP and REST service
- Provide easy to use classes for common services
- Consume some well known services such as Yahoo search and Flickr
and Amazon services using predefined classes
- Consume some well known services such as Yahoo search and Flickr
- wsdl2php.php script. This script can generate PHP classes for services
and clients for a given WSDL to be used with WSDL Mode .
Major Changes Since Last Release
- Added HTTP Authentication support in WSDL mode
- Fixed memory corruption in wsdl mode
Reporting Problems
Issues can be reported using the public JIRA available at:
https://wso2.org/jira/browse/WSFPHP
Contact Us
Please subscribe to our user or developer mailing lists. For details on how to subscribe please visit: http://wso2.org/mail#wsfphp
We welcome your early feedback on this implementation.
Thank you for your interest in WSO2 WSF/PHP.
Next WSF/PHP 1.3.0
Tuesday, May 6, 2008
Here are the list of features introduced in this release.
1. Schema constructs support improvements for WSDL mode including
SimpleType restricitons, ComplexType restrictions/extensions and attributes.
2. WSDL Import support.
3. Support for WSDLs with multiple bindings, API is provided to pick
the preferred bindings.
4. wsdl2php code generation improvements to support the improvements done in
WSDL mode.
5. HTTP Basic Authentication Support added.
6. SOAP Messages with Attachments support (SWA) added.
7. Custom Security token support added.
The release packs are almost done, and will be ready to ship on next Monday after doing all the testings.