Page 1 of 1

soap php client to wcf webservice

Posted: Thu Feb 05, 2009 12:36 pm
by tob1
Hello,

a friend published a webservice and now I would like to use it:

The webservice is written in wcf, the client in php:

interface of the webservice function:

Code: Select all

 
    Function GetData(ByVal value As Integer, ByVal value1 As Integer) As String
 
He builds up one string with value and value 1 and tries to send it back.

The client coding:

Code: Select all

$client = new
        SoapClient(
            "mywsdl"
        );
    
    $params = array('value'=>"1"); 
    $webService = $client->GetData($params);
    $wsResult = $webService->GetDataResult;
    print  $wsResult;
} catch (Exception $e) {
    print  'Caught exception: '.  $e->getMessage(). "\n";
}
This worked fine so far. Result was You entered: 1 | 0
But then I tried to pass several parameters, which didnt work.

Code: Select all

$client = new
        SoapClient(
            "mywsdl"
        );
    
    $params = array('value'=>"1",'value1' => "3"); 
    $webService = $client->GetData($params);
    $wsResult = $webService->GetDataResult;
    print  $wsResult;
} catch (Exception $e) {
    print  'Caught exception: '.  $e->getMessage(). "\n";
}
The webservice receives the first paramter and ignores the following ones.
Result as well: You entered: 1 | 0 which should have been You entered: 1 | 3

Is there anything wrong with my php coding? How can i pass several parameters to a wcf platform?

thx in advance

tob1

Re: soap php client to wcf webservice

Posted: Fri Feb 06, 2009 3:34 am
by tob1
Ok, i found out it must be a problem with document/literal of MS and rpc in PHP5. Anyone has experiences in that?