2011-02-01 39 views
2

我想創建一個php webservice服務器,從C#應用程序中使用。c#應用程序的PHP webservice

我想擁有一個自動生成wsdl文件以方便管理的庫(這就是我選擇NuSoap的原因)。

我試圖在PHP5上使用nusoap。我對字符集和Content-Type有一些問題。

Visual Studio中給出了這樣的錯誤:

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;
}
?>

是否有人知道如何改變,以使其符合和工作?

感謝

回答

相關問題