繁体   English   中英

C#从soap Webservice消耗复杂类型

[英]C# consume complex type from soap webservice

我已经在VS2010 C#中使用了Web服务。 WSDL中有一些复杂的类型,其中一种定义为:

<element name="dsPageInfo">
  <complexType>
    <sequence>
      <element maxOccurs="unbounded" minOccurs="0" name="ttPageInfo">
        <complexType>
          <sequence>
            <element name="PageTitle" nillable="true" type="xsd:string"/>
            <element name="MetaTitle" nillable="true" type="xsd:string"/>
            <element name="MetaDescription" nillable="true" type="xsd:string"/>
            <element name="MetaKeywords" nillable="true" type="xsd:string"/>
          </sequence>
        </complexType>
      </element>
    </sequence>
  </complexType>
</element>

要在VB中定义并调用此方法:

Dim webService As New myWeb.wsObjClient()

Dim systemType As String

Dim ds(0) As myWeb.dsPageInfoTtPageInfo

webService.Getpageinfo(systemType, ds)

在C#中,将Dim ds(0) As myWeb.dsPageInfoTtPageInfo于什么?

到目前为止,我有:

string systemType = "mySysType";
myWeb.wsObjClient webService = new myWeb.wsObjClient();

webSevice.Getpageinfo (
    systemType,
    // complex type goes here);

这等效于在C#中创建数组

myWeb.dsPageInfoTtPageInfo[] ds= new myWeb.dsPageInfoTtPageInfo[1]

ds[0]= new dsPageInfoTtPageInfo();
webSevice.Getpageinfo (systemType,ds); 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM