Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用SoapClient到.NETWeb服务的PHP Soap请求_Php_Soap_Service_Web_Wsdl - Fatal编程技术网

使用SoapClient到.NETWeb服务的PHP Soap请求

使用SoapClient到.NETWeb服务的PHP Soap请求,php,soap,service,web,wsdl,Php,Soap,Service,Web,Wsdl,这是我第一次在这里问一些问题:) 所以,事情是这样的: 我不熟悉Web服务WSDL和Soap,但对PHP很有经验。 我正在尝试对Web服务执行Soap请求,以下是URL: 当我尝试执行不需要参数(如“AVL”)的请求时,我得到的结果很好: <?php $options = array('soap_version' => SOAP_1_2, 'trace' => true, 'exceptions' => true, 'cache_wsdl' => WSDL_CAC

这是我第一次在这里问一些问题:)

所以,事情是这样的:

我不熟悉Web服务WSDL和Soap,但对PHP很有经验。 我正在尝试对Web服务执行Soap请求,以下是URL:

当我尝试执行不需要参数(如“AVL”)的请求时,我得到的结果很好:

<?php
$options = array('soap_version' => SOAP_1_2, 'trace' => true, 'exceptions' => true, 'cache_wsdl' => WSDL_CACHE_NONE);
$monytor = new SoapClient("http://webservice.monytor.com.br/WSGeope/ImpExpGEOPE.asmx?WSDL", $options);
$result = $monytor->AVL();
?>

由此产生:

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://webservices.monytor.com.br/WSGeope/">
<env:Body>
<ns1:AVL/>
</env:Body>
</env:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://webservices.monytor.com.br/WSGeope/">
<env:Body>
<ns1:VerifyAccess>
<ns1:Empresa>1</ns1:Empresa>
<ns1:Usuario>1</ns1:Usuario>
<ns1:Senha>test</ns1:Senha>
</ns1:VerifyAccess>
</env:Body>
</env:Envelope>

返回给我:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<AVLResponse xmlns="http://webservices.monytor.com.br/WSGeope/">
<AVLResult>
<anyType xsi:type="xsd:string">AUTOTRAC</anyType>
<anyType xsi:type="xsd:string">CHECKROTA</anyType>
<anyType xsi:type="xsd:string">CONTROLLOC</anyType>

... and so on.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<VerifyAccessResponse xmlns="http://webservices.monytor.com.br/WSGeope/">
<VerifyAccessResult>false</VerifyAccessResult>
</VerifyAccessResponse>
</soap:Body>
</soap:Envelope>

提前谢谢


对不起,我的英语不好,我是巴西人。

还有其他需要params服务的服务吗?您是否尝试过直接发布您认为正确的XML(问题的最后一部分)?是否有人验证您的用户名/密码是否正确?请尝试:1。SOAP_1_1版本2。在选项集“type_name”=>“soap”@MrCode Yes中,我尝试了(TravelExist)并首先从服务器获得了一个dateTime到字符串的转换错误,当我修复格式时,我得到了预期的“false”。如何直接发布XML?请给我举个例子。这就是让我恼火的地方,他们一直说凭证是正确的…@VitalyDyatlov仍然返回false。现在我几乎可以肯定他们提供的这些凭据不起作用。你需要与某人交谈,并检查和验证用户名/密码。要发布xml,您需要一个原始TCP客户端。我还会尝试从.NET应用程序(例如VB.NET express edition)中使用Web服务,看看是否得到相同的结果。
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<VerifyAccessResponse xmlns="http://webservices.monytor.com.br/WSGeope/">
<VerifyAccessResult>false</VerifyAccessResult>
</VerifyAccessResponse>
</soap:Body>
</soap:Envelope>
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<VerifyAccess xmlns="http://webservices.monytor.com.br/WSGeope/">
<Empresa>1</Empresa>
<Usuario>1</Usuario>
<Senha>test</Senha>
</VerifyAccess>
</soap12:Body>