Personalize
Events
ADS
Products

WSO2 mercury

0.9

WSO2 Mercury is a WS-ReliableMessaging specification implementation that uses Apache Axis2/Java as the SOAP engine.

WSO2 Identity Solution

1.5

WSO2 Identity Solution is a set of Relying Party components and an Identity Provider to enable CardSpace and OpenID authentication.

WSO2 Web Services Framework for Spring

1.0

WSO2 WSF/Spring integrates Apache Axis2 into Spring and provides a Code First approach to create Web Services for the Spring user.

WSO2 WSF/PHP

1.2.1

WSO2 WSF/PHP, a PHP extension used to provide and consume Web services in PHP.

WSO2 Mashup Server

1.0.2

WSO2 Mashup Server is a platform for creating, deploying, and consuming Web services Mashups.

WSO2 WSAS 2.2.1

2.2.1

WSO2 WSAS is an enterprise ready Web services engine powered by Apache Axis2. It is a lightweight, high performing platform for SOA

WSO2 Registry

1.0

WSO2 Registry is a Web 2.0 style registry and repository for storing resources and metadata.

WSO2 ESB

1.6

WSO2 ESB is a lightweight, XML and Web services centric ESB, based on Apache Synapse and Axis2.

WSO2 WSF C++

1.0.0

WSO2 WSF C++, a binding of WSO2 WSF/C into C++ is an extension for consuming Web Services in C++.

WSO2 User Manager

0.6

WSO2 User Manager is a library enabling user authentication and authorization in applications to be handled in a homogeneous manner.

WSO2 WSF/C

1.2.0

WSO2 WSF/C is a framework based on Apache Axis2/C, Rampart/C and Sandesha2/C for providing and consuming Web services in C.

WSO2 WSF/Ruby

1.0.0

WSO2 WSF/Ruby, a binding of WSO2 WSF/C into Ruby is an extension for consuming Web Services in Ruby.

WSO2 WSF/Perl

1.0.0

WSO2 WSF/Perl, a binding of WSO2 WSF/C into Perl is a Perl extension for consuming Web Services in Perl.

Problem webservice consume for client

Forums :

Hi,





I'm doing a test, but I have a problem. I'm did a server with WSO2 framework for php using WSDL API generation. The source of the server is:



/**

 * class student

 * @namespace http://test

 */

class Student

{

    /**

     * @property string id

     * (maps to the xs:string XML schema type )

     */

    public $id;

  

    public function __construct($id)

    {

        $this->id = $id;

    }

  

}





/**

 * @return array of object Student $a

 * (maps to the xs:anyType XML schema type )

 */

function getStudents()

{

    $a = array();

  

    for($i = 0; $i <= 2; $i++)

    {

        $a[$i] = new Student("$i");

    }

  

    return $a;

  

}





$operations = array("getStudents");

$service = new WSService(array("operations" => $operations));

$service->reply();





The wsdl output is ok, that is:





    <definitions targetNamespace="http://www.wso2.org/php">



    <types>



    <xsd:schema elementFormDefault="qualified" targetNamespace="http://www.wso2.org/php">



    <xsd:element name="getStudentsResponse">



    <xsd:complexType>



    <xsd:sequence>

<xsd:element name="a" maxOccurs="unbounded" type="ns0:Student"/>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:schema>



    <xsd:schema elementFormDefault="qualified" targetNamespace="http://test">



    <xsd:complexType name="Student">



    <xsd:sequence>

<xsd:element name="id" type="xsd:string"/>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

</types>



    <message name="getStudents">

<part name="parameters" element="tns:getStudents"/>

</message>



    <message name="getStudentsResponse">

<part name="parameters" element="tns:getStudentsResponse"/>

</message>



    <portType name="~fabio_wso2service_service.phpPortType">



    <operation name="getStudents">

<input message="tns:getStudents"/>

<output message="tns:getStudentsResponse"/>

</operation>

</portType>



    <binding name="~fabio_wso2service_service.phpSOAPBinding" type="tns:~fabio_wso2service_service.phpPortType">

<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>



    <operation name="getStudents">

<soap:operation soapAction="http://200.17.41.239/~fabio/wso2service/service.php/getStudents" style="document"/>



    <input>

<soap:body use="literal"/>

</input>



    <output>

<soap:body use="literal"/>

</output>

</operation>

</binding>



    <service name="~fabio_wso2service_service.php">



    <port name="~fabio_wso2service_service.phpSOAPPort_Http" binding="tns:~fabio_wso2service_service.phpSOAPBinding">

<soap:address location="http://localhost/~fabio/wso2service/service.php"/>

</port>

</service>

</definitions>





When I use the webservice in client, a error message is displayed.



The source of client is:





class Student {

    public $id; // string

}



// define the class map

$class_map = array("Student" => "Student");



    $client = new WSClient(array ("wsdl" =>"http://localhost/~fabio/wso2service/service.php?wsdl",

        "classmap" => $class_map));



    $proxy = $client->getProxy();

    $response = $proxy->getStudents();



When the $proxy->getStudents() method is called the mensage error is displayed:



Fatal error: Uncaught exception 'DOMException' with message 'Namespace Error' in /usr/lib/php5/20060613+lfs/wsf_php/scripts/dynamic_invocation/wsf_wsdl_client_request.php:186 Stack trace: #0 /usr/lib/php5/20060613+lfs/wsf_php/scripts/dynamic_invocation/wsf_wsdl_client_request.php(186): DOMDocument->createElementNS(NULL, 'ns1:getStudents') #1 wsf_wsdl.php(156): wsf_create_payload(Object(DOMElement), true, 'getStudents', 0, Array, Array) #2 [internal function]: wsf_process_wsdl(Array, Array) #3 [internal function]: WSClientProxy->__call('getStudents', Array) #4 /home/fabio/workspace/wso2service/client.php(16): WSClientProxy->getStudents() #5 {main} thrown in /usr/lib/php5/20060613+lfs/wsf_php/scripts/dynamic_invocation/wsf_wsdl_client_request.php on line 186



 

I tried everything to find out the cause of the problem, but not succeeded.

Someone help me?



Sorry my poor english

Hi faborm, This bug is there

Hi faborm,

This bug is there in the wsf/php 1.2.1 release, that it is not working when you don't provide any input parameters. WSF/PHP 1.3 release will be avilable soon. please use that.. I have attached the corrected service.php that worked with the latest svn. Note that you should provide the "opParams" option to the WSService. and from 1.3 release the annotation for a class varible should be declared as @var instead of @property.

 

 

Thanks

Dimuthu

AttachmentSize
service.php_.txt700 bytes