简体   繁体   English

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

[英]XML schema error - root element of a w3c xml schema

I'm trying to add a web service task via [[Visual Studio 2010 Shell for SQL Server 2012 SSIS]]. 我正在尝试通过[[Visual Studio 2010 Shell for SQL Server 2012 SSIS]]添加Web服务任务。

I have the wsdl file and the xsd file in the same folder. 我在同一文件夹中有wsdl文件和xsd文件。 When I try to reference the wsdl file below, I get the error from Visual Studio: 当我尝试引用下面的wsdl文件时,我从Visual Studio得到错误:

The root element of a W3C XML Schema should be <schema> and its namespace should be 'http://www.w3.org/2001/XMLSchema'. W3C XML Schema的根元素应为<schema> ,其名称空间应为“http://www.w3.org/2001/XMLSchema”。

Here are the first few lines of the 13,000 line wsdl file: 以下是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>

First few lines of AXLSoap.xsd: 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>

turned out to be that the element in XSD expects a fully qualified (http or https, cannot be c:\\ d:\\ relative etc.) location property. 原来是XSD中的元素需要完全限定(http或https,不能是c:\\ d:\\ relative等)的location属性。 Once I uploaded the xsd to a web server and pointed the location property to that, voila! 一旦我将xsd上传到Web服务器并将location属性指向该位置,瞧!

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

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