我在使用WCF使用PHP web服务时遇到问题。首先,我试图通过“添加服务引用”但这不工作,使代理类: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
我跟人说话,那这个托管在PHP Web服务,他说我,说他在这样的消费该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”)是需要连接哈希。
任何意见如何在C#.NET中使用此服务?
编辑:屏幕从IE:
编辑:在磁盘上的保存文件,并添加到Visual Studio(也有我的2其他WCF服务)
你可以在导航器中浏览WSDL吗? –
我编辑了我的问题,并添加了一些WSDL的截图,我在IE浏览器中看到了这些截图。 – zchpit
您可以尝试将文件保存在本地计算机上并对该文件进行引用。 –