Testing locally

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Testing locally

siva prasad verma
I have installed wso2 wsf framework on top of apache2 and copied the scripts to my web root.
I have tried to write some bits of code
this is my client code

<?php

$payloadString= <<<XML
<ns1:echo xmlns:ns1="http:wso2.org/wsf/php">
    <text>SDSLABS</text>
</ns1:echo>
XML;
//use wsf php framework
try{
    $client=new WSclient($payloadString, array("to"=>"http://localhost/spv/service_spv.php", "action"=>"echoString"));
    $responseMessage=$client->request($payloadString);
    printf("Sum is:%s<br/>", htmlspecialchars($responseMessage->str));
    //or echo $responseMessage->str;
}
catch(Exception $e){
    if($e instanceof WSFault)
    {
        printf("Soap fault: %s\n.", $e->Reason);
    }
    else
    {
        printf("Message= %s\n", $e->getMessage());
    }
}
?>

this is my server code

<?php
   
    function echoFunction() {
        $response=<<<XML
        <response>Is this working</response>
        XML;       
            $outMessage = new WSMessage($response);

            return $outMessage;
    }
    $operations=array("echoString"=>"echoFunction");
    $service=new WSService(array("opertions"=>$operations));
    $service->reply();
?>

when i try to open the client.php in my browser, I'm getting a blank page please tell me what to do get it up...!

_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Testing locally

Nandika Jayawardana
You have not defined the actions array for the service. You should
have something like
 $actions = array("echoString"=>"echoString");
which will map your operation to "echoString" action. Without it, the
service is unable to find the relevant operation to invoke. You can
refer to the log files of wsf/php to find error information. Also when
running the client, try running it on the command which is easier to
find issues and debug.

Regards
Nandika

On Tue, Feb 1, 2011 at 7:58 PM, siva prasad verma <[hidden email]> wrote:

> I have installed wso2 wsf framework on top of apache2 and copied the scripts
> to my web root.
> I have tried to write some bits of code
> this is my client code
>
> <?php
>
> $payloadString= <<<XML
> <ns1:echo xmlns:ns1="http:wso2.org/wsf/php">
>     <text>SDSLABS</text>
> </ns1:echo>
> XML;
> //use wsf php framework
> try{
>     $client=new WSclient($payloadString,
> array("to"=>"http://localhost/spv/service_spv.php",
> "action"=>"echoString"));
>     $responseMessage=$client->request($payloadString);
>     printf("Sum is:%s<br/>", htmlspecialchars($responseMessage->str));
>     //or echo $responseMessage->str;
> }
> catch(Exception $e){
>     if($e instanceof WSFault)
>     {
>         printf("Soap fault: %s\n.", $e->Reason);
>     }
>     else
>     {
>         printf("Message= %s\n", $e->getMessage());
>     }
> }
> ?>
>
> this is my server code
>
> <?php
>
>     function echoFunction() {
>         $response=<<<XML
>         <response>Is this working</response>
>         XML;
>             $outMessage = new WSMessage($response);
>
>             return $outMessage;
>     }
>     $operations=array("echoString"=>"echoFunction");
>     $service=new WSService(array("opertions"=>$operations));
>     $service->reply();
> ?>
>
> when i try to open the client.php in my browser, I'm getting a blank page
> please tell me what to do get it up...!
>
> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>
>



--
Nandika Jayawardana
Technical Lead and Project Manager,
WSO2 Inc ; http://wso2.com
lean.enterprise.middleware
_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
Loading...