1

WCF による PHP Web サービスの使用に問題があります。まず、「サービス参照の追加」でプロキシ クラスを作成しようとしましたが、うまくいきません。

ここに画像の説明を入力

完全なエラー メッセージ:

There was an error downloading 'http://xxx.yyy.zzz.pl/Swdsoapserver/query?wsdl/_vti_bin/ListData.svc/$metadata'.
The request failed with the error message:
--
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>Sender</faultcode><faultstring>Invalid XML</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

--.
Metadata contains a reference that cannot be resolved: 'http://xxx.yyy.zzz.pl/Swdsoapserver/query?wsdl'.
The content type text/html; charset=UTF-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://xxx.yyy.zzz.pl/Swdsoapserver/query" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="SwdQuerySoap"
    targetNamespace="http://xxx.yyy.zzz.pl/Swdsoapserver/query">
    <wsdl:types>
        <xsd:schema 

この Web サービスを php でホストしている人物と話したところ、彼はこの Web サービスを次のような形で使用していると言いました。

$Http = new Zend_Controller_Request_Http();
       $client = new SoapClient("http://".$Http->getServer('HTTP_HOST')."/Swdsoapserver/queryko?wsdl", array        ('trace'         => true));
       $object->sy = "12345678";
       $client->getParcel($object, base64_encode('xyzxyz'));

この base64_encode('xyzxyz') は接続に必要な Hash です。

C# .NET でこのサービスを利用する方法について何かアドバイスはありますか??

編集:IEの画面: IE1 IE2 IE3

編集: ファイルをディスクに保存し、ビジュアル スタジオに追加します (他に 2 つの wcf サービスもあります) ここに画像の説明を入力

4

1 に答える 1

1

まず、お気に入りのナビゲーターで WSDL を参照する必要があります。ファイルをローカル コンピューターに保存します。

ステップ 2、このファイルへのサービス参照を作成する必要があります。通常、プロジェクト内の PHP Web サービスに対するクライアント (WCF) が作成されます。

最後のステップでは、WCF でクライアントをインスタンス化するだけです。

于 2013-10-09T19:51:36.300 に答える