簡體   English   中英

XML模式錯誤 - w3c xml架構的根元素

[英]XML schema error - root element of a w3c xml 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>

原來是XSD中的元素需要完全限定(http或https,不能是c:\\ d:\\ relative等)的location屬性。 一旦我將xsd上傳到Web服務器並將location屬性指向該位置,瞧!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM