Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/252.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
Php 带参数的asmx HTTP Post请求_Php_Soap_Http Post_Asmx - Fatal编程技术网

Php 带参数的asmx HTTP Post请求

Php 带参数的asmx HTTP Post请求,php,soap,http-post,asmx,Php,Soap,Http Post,Asmx,我们公司有一个.net基础网站 几天前,我们向我们的网站程序员请求了一个Web服务,昨天他给我发了一个URL 当我从localhost打开URL时,它会显示一个页面,我可以选择我们请求编程的四种方法函数之一。 通过选择其中一个选项,新页面的功能如下所示: 肥皂1.1 下面是SOAP1.1请求和响应示例。显示的占位符需要替换为实际值 POST/webservices/findstatus.asmx HTTP/1.1主机:localhost 内容类型:text/xml;字符集=utf-8内容长度:长

我们公司有一个.net基础网站 几天前,我们向我们的网站程序员请求了一个Web服务,昨天他给我发了一个URL 当我从localhost打开URL时,它会显示一个页面,我可以选择我们请求编程的四种方法函数之一。 通过选择其中一个选项,新页面的功能如下所示:

肥皂1.1 下面是SOAP1.1请求和响应示例。显示的占位符需要替换为实际值

POST/webservices/findstatus.asmx HTTP/1.1主机:localhost 内容类型:text/xml;字符集=utf-8内容长度:长度 SOAPAction:

HTTP/1.1 200 OK内容类型:text/xml;字符集=utf-8 内容长度:长度

肥皂1.2 下面是SOAP1.2请求和响应示例。显示的占位符需要替换为实际值

POST/webservices/findstatus.asmx HTTP/1.1主机:localhost 内容类型:应用程序/soap+xml;字符集=utf-8内容长度: 长度

HTTP/1.1 200 OK内容类型:应用程序/soap+xml;字符集=utf-8 内容长度:长度

HTTP POST 下面是一个HTTP POST请求和响应示例。显示的占位符需要替换为实际值

POST/webservices/findstatus.asmx/FindWith_CodeR_Serail HTTP/1.1 主机:localhost内容类型:application/x-www-form-urlencoded 内容长度:长度代码接收=字符串&序列=字符串 HTTP/1.1 200 OK内容类型:text/xml;字符集=utf-8 内容长度:长度

现在我了解了使用2个参数调用此web服务的php代码 请给我完整的代码,我可以粘贴在php文件中进行测试。 无论使用哪种方法:SOAP或HTTP POST

请帮帮我

我使用了这段php代码,一切正常:

<?php

$client = new SoapClient("http://www.MyWebSite.com/webservices/findstatus.asmx?WSDL");
$params=new stdClass();
$params->CodeReception = '11111';
$params->Serial = '22222222';    
$result = $client->FindWith_CodeR_Serail($params)->FindWith_CodeR_SerailResult;
echo  $result;
?>
<?php

$client = new SoapClient("http://www.MyWebSite.com/webservices/findstatus.asmx?WSDL");
$params=new stdClass();
$params->CodeReception = '11111';
$params->Serial = '22222222';    
$result = $client->FindWith_CodeR_Serail($params)->FindWith_CodeR_SerailResult;
echo  $result;
?>
<?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>  
    <FindWith_CodeR_Serail xmlns="http://tempuri.org/">  
      <CodeReception>int</CodeReception>  
      <Serial>string</Serial>  
    </FindWith_CodeR_Serail>  
  </soap12:Body>  
</soap12: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>  
    <FindWith_CodeR_SerailResponse xmlns="http://tempuri.org/">  
      <FindWith_CodeR_SerailResult>string</FindWith_CodeR_SerailResult>  
    </FindWith_CodeR_SerailResponse>  
  </soap12:Body>  
</soap12:Envelope> 
<?xml version="1.0" encoding="utf-8"?>  
<string xmlns="http://tempuri.org/">string</string>  
<?php

$client = new SoapClient("http://www.MyWebSite.com/webservices/findstatus.asmx?WSDL");
$params=new stdClass();
$params->CodeReception = '11111';
$params->Serial = '22222222';    
$result = $client->FindWith_CodeR_Serail($params)->FindWith_CodeR_SerailResult;
echo  $result;
?>
<?php

$client = new SoapClient("http://www.MyWebSite.com/webservices/findstatus.asmx?WSDL");
$params=new stdClass();
$params->CodeReception = '11111';
$params->Serial = '22222222';    
$result = $client->FindWith_CodeR_Serail($params)->FindWith_CodeR_SerailResult;
echo  $result;
?>