I have set UP a WCF service running under basicHttpBinding. This WCF service has a method called Authenticate which returns a class of type UserInfo;
This is the code for the interface of the WCF Service
namespace SharezaBackEnd
{
// NOTE: If you change the interface name "ISharezaBL" here, you must also update the reference to "ISharezaBL" in Web.config.
[ServiceContract]
public interface ISharezaBL
{
[OperationContract]
UserInfo Authenticate(string Email, string Password);
[OperationContract]
string DoWork();
}
[DataContract]
public class UserInfo
{
[DataMember]
public string Token { get; set; }
[DataMember]
public string Error { get; set; }
}
}
Now my problem is here.
I am trying to connect to this service from PHP. I have the following code that calls the WCF service in PHP
<?php
class BackEndHandler {
function _construct() {
}
function Authenticate($param) {
try {
$wcfClient = new SoapClient("http://localhost:50850/SharezaBL.svc?wsdl");
$returnValue = $wcfClient->Authenticate($param);
return $returnValue;
}catch (SoapFault $sf) {
echo $sf->getMessage();
}
}
}
?>
and another page that calls this code
<div id="TopBar">
<?php
include 'API/BackEndHandler.php';
$handler = new BackEndHandler();
$param = Array
(
"Email" => "christianpace105@gmail.com",
"Password" => "chris21448432"
);
$userinfo = $handler->Authenticate($param);
echo $userinfo->Token;
?>
</div>
The problem lies in the part where there is echo $userinfo->Token its telling me "Undefined property: stdClass::$Token"
can anyone please help thank you

New Topic/Question
Reply



MultiQuote





|