很急!C++ Builder web service 如何处理定制的XML文件

Topgun504 2013-01-23 04:03:05
对方提供web service “deviceChanged”接口,让我去调用。
XML格式:
请求:
<?xml version="1.0" encoding="UTF-8"?>
<request>
<Device>
<deviceId>
<resId></resId>
<physId></physId>
</deviceId >
<type></type>
<vendorId></vendorId>
<vendorDeviceType></vendorDeviceType>
<hardware></hardware>
<software></software>
<description></description>
<splitterRatio></splitterRatio>
<parentDeviceId></parentDeviceId>
<splitterPosition>
<shelfNo></shelfNo>
<moduleNo></moduleNo>
<seq></seq>
</splitterPosition>
<shelfRule></shelfRule>
<shelfDirection></shelfDirection>
</Device>
<changeType></changeType>
<changeLevel></changeLevel>
</request>

对方返回的
响应:
<?xml version="1.0" encoding="UTF-8"?>
<response>
<result>
<isSuccess></isSuccess>
<failReason></failReason>
<remark></remark>
</result>
</response>
soap的包格式好像不是这样的啊,怎么构建这样的xml的数据包?
是不是把这个XML文档做为一个string 参数传过去吗?

很急,因为以前没有做过web service,请各位看看,该怎么做.谢谢啊
...全文
216 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
dfdscx 2013-01-25
  • 打赏
  • 举报
回复
用自带的importwsdl 导入后不能用么?或者你可以用HTTPReqResp来发送自己构造的xml
Topgun504 2013-01-24
  • 打赏
  • 举报
回复
引用 1 楼 cptang 的回复:
作为一个流传过去。
能不能详细一点,或有这方面的参考,谢谢
Topgun504 2013-01-24
  • 打赏
  • 举报
回复
我看到的李维书上soap包的结构: POST /PWADDEMO.ch04DemoServer/soap/IWADDemoService HTTP/1.1 Accept: application/octet-stream, text/xml Content-Type: text/xml User-Agent: Borland SOAP 1.1 Host: localhost:1024 Content-Length: 760 Connection: Keep-Alive Cookie: LastProgID <?xml version="1.0" encoding="UTF-8" ?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 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:Body> <NS1:BuyBooks xmlns:NS1="urn:WADDemoServiceIntf-IWADDemoService" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <sBookName xsi:type="xsd:string">实战C++Builder 6-SOAP/Web Service 程序设计篇 </sBookName> <sMemberID xsi:type="xsd:string">A123456789</sMemberID> <iCopies xsi:type="xsd:int">1</iCopies> <iConfirmID xsi:type="xsd:int">0</iConfirmID> <cDate xsi:type="xsd:date">2001-11-25</cDate> </NS1:BuyBooks> </SOAP-ENV:Body> </SOAP-ENV:Envelope> 怎么传我需要的XML格式啊??
zzbinfo 2013-01-23
  • 打赏
  • 举报
回复
你找点基础的看看吧,不是一句话能说清楚的。你用的什么编程环境?用2010 new-》other-》webservices 里面选择第一个,根据向导导入你这个服务,后面就好做一点了,大概是这个步骤
cptang 2013-01-23
  • 打赏
  • 举报
回复
作为一个流传过去。

1,317

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder 网络及通讯开发
社区管理员
  • 网络及通讯开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧