首页 新闻 会员 周边

这个WebService如何在WinForm中调用?

0
[已解决问题] 解决于 2009-09-24 10:03

已知: 
1,Server URL: https://dev.truemoney.co.th/cpg/CPGWSOnline/services/OnlineTopupService 
2,XML Schema: 
<?xml version = '1.0' encoding = 'UTF-8'?> 
  <schema targetNamespace="http://webservice.gateway.payment.eit.ti.com" 
xmlns="http://www.w3.org/2001/XMLSchema" 
xmlns:impl="http://webservice.gateway.payment.eit.ti.com" 
xmlns:intf="http://webservice.gateway.payment.eit.ti.com" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
  <element name="performServiceResponse"> 
    <complexType> 
    <sequence> 
      <element name="performServiceReturn" nillable="true" type="xsd:string"/> 
    </sequence> 
    </complexType> 
  </element> 
  <element name="performService"> 
    <complexType> 
    <sequence> 
      <element name="xmlInput" nillable="true" type="xsd:string"/> 
    </sequence> 
    </complexType> 
  </element> 
  </schema> 
3,Request: 
<?xml version=”1.0” encoding=”UTF-8” ?>  
<TOPUP_REQUEST> 
      <mesg_type>verify </mesg_type> 
      <cpgmerchantId>800000700 </cpgmerchantId> 
      <cpgpassword>verify </cpgpassword> 
      <trans_id>2093843982094 </trans_id> 
      <send_date>20060621 </send_date> 
      <send_time>120501 </send_time> 
      <bank_code>002 </bank_code> 
      <bank_account>17129081234 </bank_code> 
      <branch_code>180 </branch_code> 
      <channel>A </channel> 
      <term_id>S424B180A251 </term_id> 
      <service_code>TMNTOPUP </service_code>      
      <cust_no>0843454433 </cust_no> 
      <amount>50000 </amount> 
      <ref1>45664321**** </ref1> 
      <ref2>LOTUS </ref2> 
</TOPUP_REQUEST> 
在C# winform中如何调用这个webservice完成工作?

问题补充: 关键是我该如何用到这两个XML文件。
Lucker的主页 Lucker | 初学一级 | 园豆:53
提问于:2009-09-23 12:17
< >
分享
最佳答案
0

1、winform中的项目添加WEB引用

2、在弹出的对话框中输入webservice的URL,在那里输入呢,你在弹出对话框那好容易发现并且找到

3、当你输入URL后,按前往。如果这个URL接口能用,就会出现在搜索框里。。

4、当成功添加后,在项目引用那里会多一个web References,下面有个蓝绿色小球右边还带三个小黄色点。说明,添加引用成功。

5、在代码里面调用如下:(我在网上随便找了一个天气预报的接口来示例)

com.ayandy.www.getSupportCityCompletedEventArgs a = new Csharp.Test.com.ayandy.www.getSupportCityCompletedEventArgs();

com.ayandy.www就是你添加的引用命名空间,getSupportCityCompletedEventArgs 是类, 这样完成后,你用实例a去看看他有什么方法,可以让你使用就可以了。

风浪 | 老鸟四级 |园豆:2996 | 2009-09-23 14:16
其他回答(2)
0

Webclient  HttpWebRequest

流星瓶的梦 | 园豆:205 (菜鸟二级) | 2009-09-23 12:22
能不能说详细一点?这方面我没有经验。
支持(0) 反对(0) Lucker | 园豆:53 (初学一级) | 2009-09-23 12:25
@Lucker: 你百度一下吧。一下就出来了 关于webclick 或者 httpwebrequest
支持(0) 反对(0) 流星瓶的梦 | 园豆:205 (菜鸟二级) | 2009-09-23 12:33
0

在引用里--> 右击--》添加web 引用-->完后就可以调用你的web service里的方法了.

Annie | 园豆:396 (菜鸟二级) | 2009-09-23 14:56
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册