回应http post消息不成功 你是用什么发post请求的?先注释掉header语句看看 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我是以socket方式提交post请求的。这是我的客户端:<?php $data='<?xml version="1.0" encoding="utf-8"?><SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><TransactionID xmlns="http://10.1.2.122/misc/dsmp.xsd">00110100578152</TransactionID></SOAP-ENV:Header><SOAP-ENV:Body><SyncOrderRelationReq xmlns="http://10.1.2.122/misc/dsmp.xsd"><Version>1.5.0</Version><MsgType>SyncOrderRelationReq</MsgType><Send_Address><DeviceType>0</DeviceType><DeviceID>0011</DeviceID></Send_Address><Dest_Address><DeviceType>400</DeviceType><DeviceID>0</DeviceID></Dest_Address><FeeUser_ID><UserIDType>2</UserIDType><MSISDN></MSISDN><PseudoCode>00116000000099</PseudoCode></FeeUser_ID><DestUser_ID><UserIDType>2</UserIDType><MSISDN></MSISDN><PseudoCode>00116000000099</PseudoCode></DestUser_ID><LinkID>SP</LinkID><ActionID>1</ActionID><ActionReasonID>1</ActionReasonID><SPID>660002</SPID><SPServiceID>0000000243</SPServiceID><AccessMode>2</AccessMode><FeatureStr>IA==
</FeatureStr></SyncOrderRelationReq></SOAP-ENV:Body></SOAP-ENV:Envelope>'; $port=80; $length=strlen($data); $method="POST"; $path="/wap/provision.php"; $host="211.101.197.139"; $type="text/xml"; $r="\r\n"; $request = "$method $path HTTP/1.0$r"; $request.= "Host: $host$r"; $request.= "Content-Type: $type$r"; //$request.= "User-Agent: NightKids XML$r"; $request.= "Content-length: $length $r$r"; $request.= $data; $fp = @fsockopen($host,$port); if(!$fp){ $error="could not open socket."; return false; } fputs($fp,$request); while (!feof($fp)) { $wqs=fgets ($fp,300); $filename = "3.txt"; $fd = fopen( $filename, "a" ); fwrite($fd,$wqs,1400); } fclose( $fd ); fclose($fp);?>我的服务器方接收http post数据后给xml数据回应,现在的问题是。我自已写的测试客户端可以正常收到,但对方(MISC)的客户端没有收到响应包。难道我这样做不符合他们的要求。本规范定义的Web Service 接口与SOAP1.1 协议格式相绑定,所有请求和响应消息均应采用SOAP 格式的消息封装,包含SOAP 封套(Envelope),SOAP 包头(Header)和SOAP 包体(Body)三部分。对任何技术实现的调用者而言,发出的调用请求消息均须带有以上三部分内容,包头和包体消息结构中引用的类型均来自dsmp.xsd 中的定义。但在SOAP 包体中,如果按照规范定义某一参数为可选,则SOAP 消息中可不包含标识该参数的元素。返回的SOAP 消息结构同请求消息; PHP 计算器 帮帮我理解一下PHP的MVC模式 求个php处理xml的程序,在线等. 第一次使用PHP,请帮忙理解这句话的意思 求判断数据是否存在,最高效率写法! mysql_query("SET sql_mode=''")这句是什么意思? 这个程序运行速度太慢了!能改成快点吗? 哪位老大能给解释一下这是什么原因?我晕!!!!在线等!!!! PDF函数问题 如何读写文件? windows下如何解决PHP调用的外部程序超时阻塞问题 怎么随机从库中抽出一条记录?(30分)
这是我的客户端:
<?php
$data='<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Header>
<TransactionID xmlns="http://10.1.2.122/misc/dsmp.xsd">00110100578152</TransactionID>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<SyncOrderRelationReq xmlns="http://10.1.2.122/misc/dsmp.xsd">
<Version>1.5.0</Version>
<MsgType>SyncOrderRelationReq</MsgType>
<Send_Address><DeviceType>0</DeviceType>
<DeviceID>0011</DeviceID></Send_Address>
<Dest_Address><DeviceType>400</DeviceType><DeviceID>0</DeviceID></Dest_Address>
<FeeUser_ID>
<UserIDType>2</UserIDType><MSISDN></MSISDN>
<PseudoCode>00116000000099</PseudoCode>
</FeeUser_ID><DestUser_ID><UserIDType>2</UserIDType><MSISDN></MSISDN>
<PseudoCode>00116000000099</PseudoCode></DestUser_ID>
<LinkID>SP</LinkID><ActionID>1</ActionID><ActionReasonID>1</ActionReasonID><SPID>660002</SPID>
<SPServiceID>0000000243</SPServiceID>
<AccessMode>2</AccessMode><FeatureStr>IA==
</FeatureStr></SyncOrderRelationReq>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>'; $port=80;
$length=strlen($data);
$method="POST";
$path="/wap/provision.php";
$host="211.101.197.139";
$type="text/xml";
$r="\r\n";
$request = "$method $path HTTP/1.0$r";
$request.= "Host: $host$r";
$request.= "Content-Type: $type$r";
//$request.= "User-Agent: NightKids XML$r";
$request.= "Content-length: $length $r$r";
$request.= $data;
$fp = @fsockopen($host,$port);
if(!$fp){
$error="could not open socket.";
return false;
}
fputs($fp,$request);
while (!feof($fp))
{
$wqs=fgets ($fp,300);
$filename = "3.txt";
$fd = fopen( $filename, "a" );
fwrite($fd,$wqs,1400);
}
fclose( $fd ); fclose($fp);
?>我的服务器方接收http post数据后给xml数据回应,现在的问题是。
我自已写的测试客户端可以正常收到,但对方(MISC)的客户端没有收到响应包。难道我这样做不符合他们的要求。本规范定义的Web Service 接口与SOAP1.1 协议格式相绑定,所有请求和响应消
息均应采用SOAP 格式的消息封装,包含SOAP 封套(Envelope),SOAP 包头
(Header)
和SOAP 包体(Body)三部分。对任何技术实现的调用者而言,发出的调用请求消
息均
须带有以上三部分内容,包头和包体消息结构中引用的类型均来自dsmp.xsd 中的
定义。
但在SOAP 包体中,如果按照规范定义某一参数为可选,则SOAP 消息中可不包含
标识
该参数的元素。返回的SOAP 消息结构同请求消息;