WCF Services in PHP
Posted: Tue Apr 08, 2008 6:38 am
Was trying to consume WCF services in php. Followed teh steps that was mentioned in
http://weblogs.asp.net/gunnarpeipman/ar ... entmessage
after creating a WCf service ( simple an add function) and hosted in teh IIS on a differnet machine in the same network.
The php code written was :
But when i run this application i get this error:
Can someone help me with this. One more info i need to share as i told WCf service is in IIS but the php is run using apache server.
Regards
Lincy
http://weblogs.asp.net/gunnarpeipman/ar ... entmessage
after creating a WCf service ( simple an add function) and hosted in teh IIS on a differnet machine in the same network.
The php code written was :
Code: Select all
<?php
header('Content-Type: text/plain');
echo "Math Test ";
$client = new SoapClient('http://aditidt722.aditi.tech/MathService/Service.svc?wsdl');
$obj->value = 2;
$obj->value1 = 3;
$retval = $client->Add($obj);
echo "The Result is : ";
?>Code: Select all
Math Test
Fatal error: Uncaught SoapFault exception: [HTTP] Cannot process the message because the content type 'text/xml; charset=utf-8' was not the expected type 'application/soap+xml; charset=utf-8'. in C:\Documents and Settings\lincyc\My Documents\PHPDocument1.php:10
Stack trace:
#0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://aditidt7...', 'http://tempuri....', 1, 0)
#1 [internal function]: SoapClient->__call('Add', Array)
#2 C:\Documents and Settings\lincyc\My Documents\PHPDocument1.php(10): SoapClient->Add(Object(stdClass))
#3 D:\Program Files\Zend\ZendStudio-5.5.1\bin\php5\dummy.php(1): include('C:\Documents an...')
#4 {main}
thrown in C:\Documents and Settings\lincyc\My Documents\PHPDocument1.php on line 10
Regards
Lincy