引用XmlElementAttribute [英] Referencing XmlElementAttribute

查看:79
本文介绍了引用XmlElementAttribute的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个问题:

1。更优选哪种方式引用Web服务?

1. Which way to reference a web service is more preferable?

引用WSDL URL或从WSDL创建代理类并添加到项目中?

Referencing to the WSDL URL or creating a proxy class from WSDL and adding to your project?

当我使用WSDL时,我一直收到警告,例如"Schema item'complextype'named from from namespace ....无效。名称空间无法在此架构中引用"。但我可以将它附加到我的Web引用中,没有任何问题。

When I use WSDL, I've been getting warnings like "Schema item 'complextype' named ... from namespace .... is invalid. Namespace is not available to be referenced in this schema". But I can attach it to my Web References w/o any problem.

您认为以下问题与此相关吗?

Do you think the below problem is associated with that?

2。在下面的代理类代码片段中,如何从客户端引用xmlElementAttributes,因为

2. In the proxy class code snippet below, how can I reference the xmlElementAttributes from my client, because

projectionElements1.addresses不可访问。我是否需要创建序列化,反序列化代码来读取wsdl文件?或者ProjectionElements.item [0]是否指的是"地址"。 ?那么什么是"地址[0],地址[1] ......等等?

    projectionElements1.addresses is not accessible. Do I need to create serialization, deserialization code to read wsdl file? Or does ProjectionElements.item[0] refers to "addresses" ? What would be "Address[0], Address[1] ... etc then?

[System.CodeDom.Compiler.GeneratedCodeAttribute( " wsdl" "2.0.50727.42" )]

[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]

[系统。 SerializableAttribute ()]

[System.SerializableAttribute()]

[System.Diagnostics。 DebuggerStepThroughAttribute ()]

[System.Diagnostics.DebuggerStepThroughAttribute()]

[System.ComponentModel.DesignerCategoryAttribute( " code" )]

[System.ComponentModel.DesignerCategoryAttribute("code")]

[System.Xml.Serialization.XmlTypeAttribute(TypeName = " ProjectionElements" ,Namespace = " http://www.aaa.com/xmlschema / gps / partySearchCriteria / v001" )]

[System.Xml.Serialization.XmlTypeAttribute(TypeName="ProjectionElements", Namespace="http://www.aaa.com/xmlschema/gps/partySearchCriteria/v001")]

public partial < font color ="#0000ff"size = 2> class ProjectionElements1:ProjectionElements {

public partial class ProjectionElements1 : ProjectionElements {

private object itemField;

private object itemField;

/// < font color ="#008000"size = 2> < remarks />

/// <remarks/>

[System.Xml.Serialization.XmlElementAttribute( " addresses" typeof (Address []))]

[System.Xml.Serialization.XmlElementAttribute("addresses", typeof(Address[]))]

[System.Xml.Serialization.XmlElementAttribute( " alternateIds" typeof (PartyAltIdentifier []))]

[System.Xml.Serialization.XmlElementAttribute("alternateIds", typeof(PartyAltIdentifier[]))]

[系统.Xml.Serialization.XmlElementAttribute( " alternateNames" typeof (PartyAltName []))]

[System.Xml.Serialization.XmlElementAttribute("alternateNames", typeof(PartyAltName[]))]

public object Item {

public object Item {

get {

get {

return this .itemField;

return this.itemField;

}

set {

set {

this .itemField = value <字体大小= 2>;

this.itemField = value;

}

}

}

谢谢。

推荐答案

我怀疑你的WSDL缺少必需的< xs:import>声明。发布WSDL以便我们可以为您查看

希望这有助于
Irinel
I suspect your WSDL is missing a required <xs:import> statement. Post the WSDL so we can review it for you

Hope this helps
Irinel


这篇关于引用XmlElementAttribute的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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