免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2801 | 回复: 7

咨询PHP如何使用.Net开发的SOAP [复制链接]

论坛徽章:
0
发表于 2007-04-04 18:04 |显示全部楼层
现在有C#写好的一个SOAP接口。需要使用PHP调用来做一些数据的判断。

SOAP接口如下:

SOAP 1.1
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.

  1. POST /login.asmx HTTP/1.1
  2. Host: login.dc.cqit.edu.cn
  3. Content-Type: text/xml; charset=utf-8
  4. Content-Length: length
  5. SOAPAction: "http://dc.cqit.edu.cn/Login"

  6. <?xml version="1.0" encoding="utf-8"?>
  7. <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  8.   <soap:Body>
  9.     <Login xmlns="http://dc.cqit.edu.cn">
  10.       <userNo>string</userNo>
  11.       <password>string</password>
  12.       <ip>string</ip>
  13.     </Login>
  14.   </soap:Body>
  15. </soap:Envelope>
  16. HTTP/1.1 200 OK
  17. Content-Type: text/xml; charset=utf-8
  18. Content-Length: length

  19. <?xml version="1.0" encoding="utf-8"?>
  20. <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  21.   <soap:Body>
  22.     <LoginResponse xmlns="http://dc.cqit.edu.cn">
  23.       <LoginResult>string</LoginResult>
  24.     </LoginResponse>
  25.   </soap:Body>
  26. </soap:Envelope>
复制代码

SOAP 1.2
The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.

  1. POST /login.asmx HTTP/1.1
  2. Host: login.dc.cqit.edu.cn
  3. Content-Type: application/soap+xml; charset=utf-8
  4. Content-Length: length

  5. <?xml version="1.0" encoding="utf-8"?>
  6. <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">
  7.   <soap12:Body>
  8.     <Login xmlns="http://dc.cqit.edu.cn">
  9.       <userNo>string</userNo>
  10.       <password>string</password>
  11.       <ip>string</ip>
  12.     </Login>
  13.   </soap12:Body>
  14. </soap12:Envelope>
  15. HTTP/1.1 200 OK
  16. Content-Type: application/soap+xml; charset=utf-8
  17. Content-Length: length

  18. <?xml version="1.0" encoding="utf-8"?>
  19. <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">
  20.   <soap12:Body>
  21.     <LoginResponse xmlns="http://dc.cqit.edu.cn">
  22.       <LoginResult>string</LoginResult>
  23.     </LoginResponse>
  24.   </soap12:Body>
  25. </soap12:Envelope>
复制代码

PHP中如何做到将userNo和password传递过去并获得结果呢?

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
发表于 2007-04-04 18:23 |显示全部楼层
找个soap库来跟着例子写啊,我晓得的php soap库就是nusoap,google一下

论坛徽章:
0
发表于 2007-04-04 18:26 |显示全部楼层
不用在乎 SOAP 的服务端是什么语言开发的

只要知道 地址、连接授权、函数名参数 即可

论坛徽章:
0
发表于 2007-04-04 18:39 |显示全部楼层
楼上两位,现在的关键就是头一次弄这个,不知道怎么写啊~~

Nusoap可以啊,谁能给个例子,呵呵

[ 本帖最后由 gregry 于 2007-4-4 18:41 编辑 ]

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
发表于 2007-04-04 18:55 |显示全部楼层
你这个要求,google比我们都靠得住

论坛徽章:
0
发表于 2007-04-04 18:57 |显示全部楼层
原帖由 夜猫子 于 2007-4-4 18:55 发表
你这个要求,google比我们都靠得住

汗水……

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
发表于 2007-04-04 21:04 |显示全部楼层
SOAP有固定的规范,你按照规范来做,没什么太难的得啊。

论坛徽章:
0
发表于 2007-04-06 17:30 |显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP