Flickr online Application
Saturday, April 26, 2008
WSF/PHP 1.2.2 & wsdl2php
Thursday, April 24, 2008
The enhancements done to wsdl2php tool to support as much schema constructs as possible is the key highlight of the upcoming WSO2 WSF/PHP 1.2.2 release.
One of the key limitations of the built in SOAP extension is the level of schema support. I have seen many users complaining on this on the PHP SOAP list.
The amount of schema coverage that you get with WSF/PHP also beats out NuSOAP WSDL support. We have done considerable amount of testing for a large number of WSDL files with various schema constructs for WSF/PHP.
I expect the wsdl2php tool be the killer tool that help solve all the problems that PHP users faced with WSDL.
WSF/PHP 1.2.2 is ready to ship
Monday, April 21, 2008
Here is a list of WSDL and Schema Constructs it is going to support,
Elements with simpleType
simpleType restriction
simpleType list
complexType sequence
complexType all/choice
inner content models
complexContent extension (non xsi:type based serializing, parsing)
complexContent restriction
attribute
simpleContent extension
attributeGroup
WSDL import
anyAttribute
custom headers
xsi:type" based serialization and parsing
Mtom support with WSDL mode
We would be able to do the release early next week. Hope you will enjoy the new feature set.
WSF/PHP with doc-lit bare WSDLs
Wednesday, April 16, 2008
<echoInt>3</echoInt>In order to prepare this message with wsdl mode in WSF/PHP you can directly input the parameter value without instantiate any wrapper classes. Just take look at the following doc-lit bare WSDL and the corresponding WSDL-mode client to have an idea how easy it is.
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:ns0="http://wso2.org/dyn/codegen/demo"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:ns1="http://wso2.org/dyn/codegen/demo/xsd"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://wso2.org/dyn/codegen/demo">
<wsdl:types>
<xs:schema xmlns:tns="http://wso2.org/dyn/codegen/demo"
attributeFormDefault="qualified"
elementFormDefault="qualified" targetNamespace="http://wso2.org/dyn/codegen/demo">
<xs:element name="echoInt" type="xs:int"/>
<xs:element name="echoIntResponse" type="xs:int"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="echoIntRequest">
<wsdl:part name="parameters" element="ns0:echoInt"/>
</wsdl:message>
<wsdl:message name="echoIntResponse">
<wsdl:part name="parameters" element="ns0:echoIntResponse"/>
</wsdl:message>
<wsdl:portType name="EchoServicePortType">
<wsdl:operation name="echoInt">
<wsdl:input message="ns0:echoIntRequest" wsaw:Action="urn:echoInt"/>
<wsdl:output message="ns0:echoIntResponse" wsaw:Action="urn:echoIntResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="EchoServiceSOAP12Binding" type="ns0:EchoServicePortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="echoInt">
<soap12:operation soapAction="urn:echoInt" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="EchoService">
<wsdl:port name="EchoServiceSOAP12port_http" binding="ns0:EchoServiceSOAP12Binding">
<soap:address location="http://localhost:8080/dyn/codegen/demo/services/EchoService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
And the client is simple as this
// the background work for create wsclient and the proxySo in a case where you just need to send only one parameter for the service operation, this form of messages make your web service call more efficient and more easy to implement.
$client = new WSClient(array ("wsdl" =>"echo.wsdl"));
$proxy = $client->getProxy();
// you directly input the request parameter
$response = $proxy->echoInt(3);
echo $response;
PHP Web Services With IIS
Tuesday, April 1, 2008
It is possible for you do deploy PHP Web Services using WSF/PHP in IIS. Following the steps to install WSF/PHP in IIS.
1. Configure PHP With IIS.
You can find a complete guide to installing PHP with IIS from php documentation. http://www.php.net/manual/en/install.windows.iis.php
2. Configure WSF/PHP with PHP
Configuring WSF/PHP with PHP is quite easy. But you have to follow few additional steps to get it working on IIS.
i. Extract wsf/php binary can copy wsf.dll to your php extensions directory.
ii. Set following php.ini settings.
extension_dir=E:\php5\ext { Here my E:\php5 is the location where I have extracted the php binary. Note that I have not used any quotes in the php. If you have paths, It will not work properly.
wsf.home=<path to php binary extract directory>\wsf_c\lib
wsf.log_path=<path to php binary extract directory>\wsf_c\logs
wsf.rm_db_dir=<path to php binary extract directory>\wsf_c\
wsf.log_level=4
iii) add wsf php dependencies and <wsf-php-bin>\wsf_c\lib directory to path System variable
3. Copy the samples, start IIS
Copy the samples directory to C:\Inetpub\webroot directory.
Start IIS with the following command
net start w3svc
Now use the <?php phpinfo(); ?> script to check whether wsf extension is load properly. You can simply copy and paste the above script to a file and put it in to C:\inetpub\webroot directory and try it. If the wsf extension is show in the page then all is fine. If it is not there check whether you have added the dependencies ( Libxml2, iconv) and <wsf-php-bin>\wsf_c\lib directory to the path system variable properly. Sometimes you may need to restart the machine to get these changes to the path to work properly.
Once you have the wsf extension loaded, you can run the samples.