首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式碼之家 >> 編程語言 >  >> C語言 >> 關於C語言

C# 使用 HttpWebRequest 呼叫 Web Service 範例(一)

     編輯:關於C語言

上一篇文章是關於 CMPP3.0 的 C# 實作,我為了測試其中的 PROVISION 介面,利用 System.Net.HttpWebRequest 類別將《MISC系統短信SP接入指南-接口改造分冊》文件中的示例 XML 發送到 Web Service,並從 Web Service 取回對應的 Resp 封包(也是一段 XML),下面將程式碼貼出:

1、SyncOrderRelationReq 封包的 XML 內容:

<SOAP-ENV:Envelope xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="https://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="https://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="https://schemas.XMLsoap.org/soap/encoding/">
 <SOAP-ENV:Header>
 <TransactionID XMLns="https://www.monternet.com/dsmp/schemas/">00110318384464</TransactionID>
 </SOAP-ENV:Header>
 <SOAP-ENV:Body>
 <SyncOrderRelationReq XMLns="https://www.monternet.com/dsmp/schemas/">
 <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>1</UserIDType>
 <MSISDN>13456781234</MSISDN>
 <PseudoCode></PseudoCode>
 </FeeUser_ID>
 <DestUser_ID>
 <UserIDType>1</UserIDType>
 <MSISDN>13456781234</MSISDN>
 <PseudoCode></PseudoCode>
 </DestUser_ID>
 <LinkID>SP</LinkID>
 <ActionID>1</ActionID>
 <ActionReasonID>1</ActionReasonID>
 <SPID>419000</SPID>
 <SPServiceID>-YYXXYYXX</SPServiceID>
 <AccessMode>3</AccessMode>
 <FeatureStr>MTA2NjIxNDQgREE=</FeatureStr>
 </SyncOrderRelationReq>
 </SOAP-ENV:Body>
< /SOAP-ENV:Envelope>
  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式碼之家 All Rights Reserved