从我的桌面csharp项目连接特殊的基本soap webservise [英] Connecting special basic soap webservise from my desktop csharp project

查看:290
本文介绍了从我的桌面csharp项目连接特殊的基本soap webservise的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法连接到网络服务-遍历每个示例和视频,但:( < 我需要一个有关
的简单示例 akakceOrderServices网络服务 [

i can''t connecting to webservice - itried to every sample and video but :(
i need one simple example about
akakceOrderServices Web Service[^]
pls help



POST /akakcem/online-store/siparis-yonetimi/api/orderServices.asmx HTTP/1.1
Host: www.akakce.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://orderservices.akakce.com/getOrders"

<?xml version="1.0" encoding="utf-8"?>
<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/">
  <soap:Header>
    <Authentication xmlns="http://orderservices.akakce.com/">
      <username>string</username>
      <password>string</password>
    </Authentication>
  </soap:Header>
  <soap:Body>
    <getOrders xmlns="http://orderservices.akakce.com/">
      <listType>LIST_TODO or LIST_ALL or LIST_NEW or LIST_CANCELLED or LIST_WAITING_FOR_SHIPMENT or LIST_COMPLETED</listType>
      <startDate>dateTime</startDate>
      <endDate>dateTime</endDate>
    </getOrders>
  </soap:Body>
</soap:Envelope>



我尝试过的事情:



What I have tried:

Akakce.getOrdersRequest _client2 = new Akakce.getOrdersRequest();
            AkakceXml.Akakce.Authentication _client = new AkakceXml.Akakce.Authentication();
            _client.username = "username";
            _client.password = "password";
            Akakce.getOrdersRequest result = new Akakce.getOrdersRequest(_client, Akakce.orderListFilter.LIST_COMPLETED, Convert.ToDateTime("2019-01-01"), Convert.ToDateTime("2019-06-06"));
            rText1.Text = "serviceStatus : " + result..ToString() + "\n\r";
            rText1.Text += "errDescription : " + result.errDescription.ToString() + "\n\r";

            var Kullanicilar = result.orders.ToList();
            var Tumbilgiler = from Kullanici in Kullanicilar
                              select Kullanici;
            foreach (var Fatura in Tumbilgiler)
            {
                MessageBox.Show(Fatura.customerInfo.customerName.ToString());
                rText1.Text += "orders : " + Fatura.orderID.ToString();
                rText1.Text += "İsim Soyisim : " + Fatura.customerInfo.deliverToName + Fatura.customerInfo.deliverToSurname;
            }
            dataGridView1.DataSource = result.orders.ToList();

推荐答案

以下内容似乎对我有用(由于我不知道凭据,我当然会收到身份验证错误),但是返回了预期的结构...
The following seems to work for me (of course I get an authentication error as I don''t know credentials) but the expected structures are returned...
AkakceXml.Akakce.Authentication _client = new AkakceXml.Akakce.Authentication();
_client.username = "username";
_client.password = "password";
AkakceXml.akakce.akakceOrderServicesSoapClient() ak = new AkakceXml.akakce.akakceOrderServicesSoapClient();
AkakceXml.akakce.orderReport result = ak.getOrders(_client, AkakceXml.akakce.orderListFilter.LIST_COMPLETED, Convert.ToDateTime("2019-01-01"), Convert.ToDateTime("2019-06-06"));
rText1.Text = "serviceStatus : " + result.ToString() + "\n\r";
rText1.Text += "errDescription : " + result.errDescription + "\n\r";

var Kullanicilar = result.orders.ToList();
.
.
.

顺便说一句,您不需要在errDescriptioncustomerNameorderID上调用ToString()方法,因为这些属性始终被定义为字符串.同时从result..ToString()

By the way, you don''t need the ToString() method calls on errDescription, customerName and orderID as these properties are defined as strings anyway. Also remove the double .. from result..ToString()


这篇关于从我的桌面csharp项目连接特殊的基本soap webservise的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆