PHP webservice for c# application
Posted
by
user293995
on Stack Overflow
See other posts from Stack Overflow
or by user293995
Published on 2011-02-01T15:00:36Z
Indexed on
2011/02/08
15:25 UTC
Read the original article
Hit count: 285
Hi,
I want to create a php webservice server to be used from a C# application.
I want to have a library who autogenerate wsdl file for easy management (That's the reason why I choosed NuSoap).
I tried to use nusoap on PHP5. I have some problems with charset and Content-Type.
Visual Studio gives this error :
The HTML document does not contain Web service discovery information.
Metadata contains a reference that cannot be resolved: 'https://www.xxx.yy'.
There is a problem with the XML that was received from the network. See inner exception for more details.
The encoding in the declaration 'ISO-8859-1' does not match the encoding of the document 'utf-8'.
If the service is defined in the current solution, try building the solution and adding the service reference again.
$soap= new soap_server();
$soap->xml_encoding = 'utf-8';
$soap->configureWSDL('Bonjour', 'https://www.xxx.yy');
$soap->wsdl->schemaTargetNamespace = 'http://soapinterop.org/xsd/';
$soap->register('bonjour', array('prenom' => 'xsd:string'));
$HTTP_RAW_POST_DATA = file_get_contents("php://input");
$soap->service($HTTP_RAW_POST_DATA);
header('Content-Type: application/soap+xml; charset=utf-8');
function bonjour($prenom)
{
return "Bonjour ".$prenom;
}
?>
Does someone knows how to change that to make it compliant and working ?
Thanks
© Stack Overflow or respective owner