C# アプリケーションから使用する php Web サービス サーバーを作成したいと考えています。
簡単に管理できるように、wsdl ファイルを自動生成するライブラリが必要です (これが、NuSoap を選択した理由です)。
PHP5でnusoapを使ってみました。charset と 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;
}
?>
誰かがそれを変更して準拠し、機能させる方法を知っていますか?
ありがとう