XML模式错误 - w3c xml架构的根元素

时间:2013-01-19 03:33:38

标签: xml visual-studio ssis wsdl schema

我正在尝试通过[[Visual Studio 2010 Shell for SQL Server 2012 SSIS]]添加Web服务任务。

我在同一个文件夹中有wsdl文件和xsd文件。当我尝试引用下面的wsdl文件时,我从Visual Studio得到错误:

W3C XML Schema的根元素应为<schema>,其名称空间应为“http://www.w3.org/2001/XMLSchema”。

以下是13,000行wsdl文件的前几行:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://www.cisco.com/AXLAPIService/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:xsd1="http://www.cisco.com/AXL/API/8.0" targetNamespace="http://www.cisco.com/AXLAPIService/">
<import location="AXLSoap.xsd" namespace="http://www.cisco.com/AXL/API/8.0"/>
<message name="addSipProfileIn">
<part element="xsd1:addSipProfile" name="axlParams"/>
</message>

AXLSoap.xsd的前几行:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.cisco.com/AXL/API/8.0" xmlns:axlapi="http://www.cisco.com/AXL/API/8.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="unqualified" version="8.0">
<xsd:complexType name='XSipProfile'>
<xsd:sequence minOccurs='0'>
<xsd:element maxOccurs='1' nillable='false' name='name' minOccurs='1' type='axlapi:String50'></xsd:element>

1 个答案:

答案 0 :(得分:3)

原来是XSD中的元素需要完全限定(http或https,不能是c:\ d:\ relative等)的location属性。一旦我将xsd上传到Web服务器并将location属性指向该属性,瞧!

相关问题