下面是我以前对Php的soap接口进行抓包分析出的结果,这个分析在当服务端或者客户端的Php没有安装soap模块时,可以使用构建xml的方式实现相同的功能

服务端:

 $data = $HTTP_RAW_POST_DATA;
$data = file_get_contents('php://input');
$server = new SoapServer(null, array('uri' => "http://abc-soap-duba/"));
$server->addFunction("sendtask");
$server->handle($data);
function sendtask()
{
return "ok";
}

客户端代码  

    <?php
$client = new SoapClient(null, array('location' => "http://api.abc.cn/taskserver.php",
'uri' => "http://abc-soap-duba/"));
$username="cdn@abc.cn";
$password=md5("123456");
$domain="www.abc.cn";
$pathsizelist="/images/ad2.gif,4846,/images/ad3.gif,5788,/images/ico01.gif,1089,/images/logo.gif,1605";
echo $client->sendtask($username,$password,$domain,$pathsizelist);
?>

客户端发出的数据:

    POST /b.php HTTP/1.1
Host: api.abc.cn
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.2.2
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://abc-soap-duba/#sendtask"
Content-Length: 766
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://abc-soap-duba/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:sendtask>
<param0 xsi:type="xsd:string">cdn@abc.cn</param0>
<param1 xsi:type="xsd:string">e10adc3949ba59abbe56e057f20f883e</param1>
<param2 xsi:type="xsd:string">www.abc.cn</param2>
<param3 xsi:type="xsd:string">/images/ad2.gif,4846,/images/ad3.gif,5788,/images/ico01.gif,1089,/images/logo.gif,1605</param3>
</ns1:sendtask>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

当server中没有改函数时返回的结果

    <?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>SOAP-ENV:Server</faultcode><faultstring>Function 'sendtasks' doesn't exist</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

当server中有该函数时的结果

    <?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://abc-soap-duba/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:sendtaskResponse>
<return xsi:type="xsd:string">ok</return>
</ns1:sendtaskResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

end

捕捉soap的xml形式的更多相关文章

  1. 2.Java实现基于SOAP的XML文档网络传输及远程过程调用(RPC)-

    转自:https://blog.csdn.net/a214919447/article/details/55260411 SOAP(Simple Object Access Protocol,简单对象 ...

  2. PHP以xml形式获取POST数据

    <?php namespace Home\Controller; use Think\Controller; class UrlController extends Controller { / ...

  3. Spinner 通过XML形式绑定数据时 无法从String.xml中读取数组

    在android应用程序中,通过XML形式给Spinner绑定数据,如果把数组放在系统的string.xml文件里,那么就有可能在运行时无法找到,导致程序异常结束,解决方法是自建一个XML文件来存放数 ...

  4. 5.使用SOAP的XML消息传递

    转自:https://blog.csdn.net/u014066037/article/details/51724658 使用SOAP的XML消息传递的简易流程图: 详细步骤如下: (1)服务请求者的 ...

  5. TestNg之XMl形式实现多线程测试

    为什么要使用多线程测试? 在实际测试中,为了节省测试时间,提高测试效率,在实际测试场景中经常会采用多线程的方式去执行,比如爬虫爬数据,多浏览器并行测试. 关于多线程并行测试 TestNG中实现多线程并 ...

  6. SQL Server 将查询结果集以XML形式展现 for xml path

    for xml path,其实它就是将查询结果集以XML形式展现 双击打开

  7. requests接口自动化8-传递数据为xml形式的post请求:data

    传递数据为xml形式的post请求 请求体内容: <?xml version=“1.0” encoding = “UTF-8”?> <COM> <REQ name=&qu ...

  8. mybatis-plus 自定义SQL,XML形式,传参的几种方式

    mybatis-plus 自定义SQL,XML形式,传参的几种方式 前提说明 所涉及文件 传参类型说明 1.Java代码中使用QueryWrapper动态拼装SQL 2.简单类型参数(如String, ...

  9. 基于SOAP的xml网络交互心得

    感谢小二同学将遇到的问题分享给我们,再此给以掌声.如果看不懂下面文章的建议查找一下HTTP协议的文艺,对HTTP协议要有个概念. XML网络交互心得 目录 一.     xml解析 1.根路径下 2. ...

随机推荐

  1. Console.WriteLine 不会输出到unity控制台

    1,Console.WriteLine() 是输出到控制台程序(console application)的命令 2,Unity中控制台是一个独立的程序,要想输出到Unity控制台需要使用Debug.L ...

  2. DDD中 与Dto搭配的AutoMapper插件,摘自《NET企业级应用架构设计》

    AutoMapper插件 实现了 DTO与Model的互相映射.

  3. 第十二章 Python网络编程

    socket编程 socket是应用层与TCP/IP协议族通信的中间软件抽象层,它是一组接口.它把复杂的TCP/IP协议族隐藏在Socket接口后面,对用户来说,一组简单的接口就是全部,让Socket ...

  4. Java模拟数据量过大时批量处理数据的两种实现方法

    方法一: 代码如下: import java.util.ArrayList; import java.util.List; /** * 模拟批量处理数据(一) * 当数据量过大过多导致超时等问题可以将 ...

  5. You-Dont-Need-JQuery (你不需要JQuery)

    看完这篇文章我才觉得真的要用JQuery ,因为实在是有些地方设计的使用太复杂了, document.querySelector() 和 Document.querySelectorAll 的确是很方 ...

  6. UVA272-TEX Quotes(紫书例题3.1)

    TeX is a typesetting language developed by Donald Knuth. It takes source text together with a few ty ...

  7. ubuntu18.04crontab定时任务不执行

    环境介绍: 本人使用python写了一个自动化提交巡检的脚本放在服务器上,使用crontab去执行脚本的时候动作并没有执行,查看crontab日志时也不存在这个日志文件.如何如排查呢? 解决方案: 步 ...

  8. 优化VR体验的7个建议

    本文章由cartzhang编写,转载请注明出处. 所有权利保留. 文章链接: http://blog.csdn.net/cartzhang/article/details/50392607 作者:ca ...

  9. android camera2

    1.camera2api的部分描述: CameraCaptureSession api地址:https://developer.android.com/reference/android/hardwa ...

  10. [terry笔记]python购物程序

    如下是一个购物程序: 先输入工资,显示商品列表,购买,quit退出,最后格式化输出所买的商品. count = 0 while True: #做一个循环判断,如果输入的不是数字,基于提示,三次后退出 ...