.NET 4.0 wsdl的wsimport失败 [英] wsimport failure with .NET 4.0 wsdl

查看:144
本文介绍了.NET 4.0 wsdl的wsimport失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[WARNING] src-resolve.4.2: Error resolving component 'xs:schema'. It was detecte
d that 'xs:schema' is in namespace 'http://www.w3.org/2001/XMLSchema', but compo
nents from this namespace are not referenceable from schema document 'http://loc
alhost/BankService/AccountService.svc?xsd=xsd0'. If this is the incorrect namesp
ace, perhaps the prefix of 'xs:schema' needs to be changed. If this is the corre
ct namespace, then an appropriate 'import' tag should be added to 'http://localh
ost/BankService/AccountService.svc?xsd=xsd0'.
  line 1 of http://localhost/BankService/AccountService.svc?xsd=xsd0

推荐答案

XML模式依赖于名称空间. Document.createElement()Element.setAttribute()创建缺少名称空间的元素和属性节点,这些节点和属性节点缺少本地名称和名称空间URI.绝对不要将DOM Level 1非命名空间工厂方法与包含名称空间感知节点的DOM(或期望使用名称空间感知节点的API)一起使用.新元素/属性节点应通过调用
来创建 Document.createElementNS() [1]和Element.setAttributeNS() [2].
例如
XML Schema depends on namespaces. Document.createElement() and Element.setAttribute() create non-namespace-aware element and attribute nodes which are missing a local name and namespace URI. You should never use the DOM Level 1 non-namespace factory methods with a DOM containing namespace-aware nodes (or with APIs expecting namespace-aware nodes). New element/attribute nodes should be created by calling
Document.createElementNS() [1] and Element.setAttributeNS() [2].
e.g.
Change:
    document.createElement("s:import")
To:
    document.createElementNS("http://www.w3.org/2001/XMLSchema", "s:import")



[1] http://www.w3 .org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-DocCrElNS
[2] http://www.w3 .org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-ElSetAttrNS


[来自Google的第一个答案!]



[1] http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-DocCrElNS
[2] http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-ElSetAttrNS


[that is from the FIRST answer on google!]


这篇关于.NET 4.0 wsdl的wsimport失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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