php处理xml soap数据的一些小工具
由于要编写MMS彩信服务,搜索了一些php上关于WebService soap处理的相关工具,虽然最后没有使用php直接来处理彩信的收发,但是资料工具整理一下,供以后类似需要的地方使用。
处理Soap数据
- 1. NuSoap
- 2. php5内带的soap模块
- 3.WSO2 WSF/PHP
这个网上的介绍的很多
需要添加相应的扩展,要不然不能使用。
这个看上去不错,不过没有做尝试
处理wsdl 的辅助工具
- 1. WSDL to Php Code
- 2. WSDL2php
- 3. WSDLInterpreter
这个只提供在线的转化,需要将wsdl文件放在外网可以访问的网络上,然后在 http://1018-media.com/wsdlstubgen/ 这个地址生成所需要的代码。不过这个网址要使用代理才能访问。
所在网址: http://www.urdalen.no/wsdl2php/
这个生成的代码最详细,有wsdl中的数据类型定义生成,方便做数据校验处理。
所在网址: http://code.google.com/p/wsdl2php-interpreter/
Popularity: 6% [?]
Related
带附件内容的Soap数据包格式分析
MMS彩信发送在正常的soap xml包体外还需要附加彩信数据,经过抓包分析,发现采用 multipart/related 方式发送。
start部分发送的是Soap的数据包,其他为附加的彩信文件, 采用头部的boundary设定来做多块数据的分隔。
一个抓下来的部分包
post的header头部分
POST /wespa_mms/services/SendMessage HTTP/1.1 Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_31E20DB13F6FA8BB9A1234336210043; type="text/xml"; start="<0.urn:uuid:31E20DB13F6FA8BB9A1234336210044@apache.org>" SOAPAction: "" User-Agent: Axis2 Host: 127.0.0.1:5555 Transfer-Encoding: chunked
post的数据体部分
--MIMEBoundaryurn_uuid_31E20DB13F6FA8BB9A1234336210043 Content-Type: text/xml; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-ID: <0.urn:uuid:31E20DB13F6FA8BB9A1234336210044@apache.org> <?xml version='1.0' encoding='UTF-8'?>xml包体内容 --MIMEBoundaryurn_uuid_31E20DB13F6FA8BB9A1234336210043 Content-Type: text/plain Content-Transfer-Encoding: binary Content-ID: <att_file2> file2文件内容 --MIMEBoundaryurn_uuid_31E20DB13F6FA8BB9A1234336210043 Content-Type: text/plain Content-Transfer-Encoding: binary Content-ID: <file_1> file_1文件内容 --MIMEBoundaryurn_uuid_31E20DB13F6FA8BB9A1234336210043--
Popularity: 6% [?]