|
|
|
start date: Wed, 22 Aug 2007 02:10:39 -0000,
posted on: microsoft.public.dotnet.xml
back
| Thread Index |
|
1
wowfed
|
|
2
Martin Honnen
|
|
3
wowfed
|
XML schema validation with web services
I'm getting following errors in my schema validation .
Error Message: The 'TimeSeries' element is not declared. An error
occurred at , (1, 2).
The 'http://alx.ml.com/mapsws:BoxColor' attribute is not declared. An
error occurred at , (1, 163).
It would be great if some one could tell me what Im doing wrong. ?
It works fine , if I remove the targetnamespace and xmlns elements
from
schema file and also remove xlmns attribute from xml document.
This TimeSeries object is passed as a parameter to my web service
method(GetTimeSeries). And the raw soap msg is adding the namespace
xmlns:d4p1="http://alx.ml.com/mapsws" to the xml submitted as part of
the request.
Here is the xml
<?xml version="1.0" encoding="utf-8" ?>
<TimeSeries d4p1:XTitle="Date" d4p1:YTitle=""
d4p1:Y2Title="Y2" d4p1:YMin="auto" d4p1:YMax="100" d4p1:Y2Min="auto"
d4p1:Y2Max="auto" d4p1:Format="1" d4p1:Dec="3"
d4p1:BoxColor="Off_White" d4p1:BackColor="White" d4p1:AppToken="myapp"
xmlns:d4p1="http://alx.ml.com/mapsws">
<d4p1:yseries>
<d4p1:YSeries>
<d4p1:MarkerStep>10</d4p1
:MarkerStep>
<d4p1:Colors>Red</d4p1:Colors>
<d4p1:LineStyle>solid</d4p1:LineStyle>
<d4p1:Markers>No_point</d4p1:Markers>
<d4p1:Linewidth>1</d4p1:Linewidth>
<d4p1:Legend>BMA 5Y Ratio</d4p1:Legend>
<d4p1:Direction>Left</d4p1:Direction>
<d4p1:tssecurity>
<d4p1:sec>BMA5</d4p1:sec>
<d4p1:field>1106</d4p1:field>
</d4p1:tssecurity>
</d4p1:YSeries>
<d4p1:period>FiveYear</d4p1:period>
<d4p1:ShowConstantLine>false</d4p1:ShowConstantLine>
</TimeSeries>
Here is the schema
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema elementFormDefault="qualified"
attributeFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/
XMLSchema"
xmlns:mapsws="http://alx.ml.com/mapsws" targetNamespace="http://
alx.ml.com/mapsws" >
<xs:attribute name="Min" type="xs:string" default="auto" />
<xs:attribute name="Max" type="xs:string" default="auto" />
<xs:attribute name="Format" type="xs:int" default="1" />
<xs:attribute name="Dec" type="xs:int" default="3" />
<xs:attribute name="XTitle" type="xs:string" />
<xs:attribute name="YTitle" type="xs:string" />
<xs:attribute name="ChartTitle" type="xs:string" />
<xs:attribute name="YMin" type="xs:string" default="auto" />
<xs:attribute name="YMax" type="xs:string" default="auto" />
<xs:attribute name="Y2Min" type="xs:string" default="auto" />
<xs:attribute name="Y2Max" type="xs:string" default="auto" />
<xs:attribute name="Y2Title" type="xs:string" />
<xs:element name="MarkerStep" type="xs:int" />
<xs:element name="Linewidth" type="xs:double" />
<xs:element name="Legend" type="xs:string" />
<xs:element name="StartDate" type="xs:date" />
<xs:element name="EndDate" type="xs:date" />
<xs:element name="COB" type="xs:boolean" />
<xs:element name="ShowConstantLine" type="xs:boolean"
default="false" />
<xs:attribute name="Height" default="400">
<xs:simpleType>
<xs:restriction base="xs:int">
<xs:minInclusive value="200" />
<xs:maxInclusive value="1200" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Width" default="800">
<xs:simpleType>
<xs:restriction base="xs:int">
<xs:minInclusive value="200" />
<xs:maxInclusive value="1200" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:simpleType name="Colors">
<xs:restriction base="xs:string">
<xs:enumeration value="Blue" />
<xs:enumeration value="Red" />
<xs:enumeration value="Green" />
</xs:restriction>
</xs:simpleType>
<xs:element name="Colors" type="mapsws:Colors" />
<xs:simpleType name="Direction">
<xs:restriction base="xs:string">
<xs:enumeration value="Left" />
<xs:enumeration value="Right" />
</xs:restriction>
</xs:simpleType>
<xs:element name="Direction" type="mapsws:Direction" />
<xs:simpleType name="Axis">
<xs:restriction base="xs:string">
<xs:enumeration value="X" />
<xs:enumeration value="Y" />
</xs:restriction>
</xs:simpleType>
<xs:element name="Axis" type="mapsws:Axis" />
<xs:simpleType name="Markers">
<xs:restriction base="xs:string">
<xs:enumeration value="No_point" />
<xs:enumeration value="Circle" />
</xs:restriction>
</xs:simpleType>
<xs:element name="Markers" type="mapsws:Markers" />
<xs:simpleType name="MarkerSize">
<xs:restriction base="xs:int">
<xs:enumeration value="1" />
<xs:enumeration value="2" />
</xs:restriction>
</xs:simpleType>
<xs:element name="MarkerSize" type="mapsws:MarkerSize" />
<xs:simpleType name="LineStyle">
<xs:restriction base="xs:string">
<xs:enumeration value="solid" />
<xs:enumeration value="dash" />
</xs:restriction>
</xs:simpleType>
<xs:element name="LineStyle" type="mapsws:LineStyle" />
<xs:simpleType name="Frequency">
<xs:restriction base="xs:string">
<xs:enumeration value="Natural" />
<xs:enumeration value="Daily" />
</xs:restriction>
</xs:simpleType>
<xs:element name="Frequency" type="mapsws:Frequency" />
<xs:simpleType name="FrequencyDay">
<xs:restriction base="xs:string">
<xs:enumeration value="Monday" />
<xs:enumeration value="Friday" />
</xs:restriction>
</xs:simpleType>
<xs:element name="FrequencyDay" type="mapsws:FrequencyDay" />
<xs:simpleType name="FrequencyMonth">
<xs:restriction base="xs:string">
<xs:enumeration value="FirstOfMonth" />
<xs:enumeration value="FifteenthOfMonth" />
<xs:enumeration value="EOM" />
</xs:restriction>
</xs:simpleType>
<xs:element name="FrequencyMonth" type="mapsws:FrequencyMonth" />
<xs:simpleType name="Period">
<xs:restriction base="xs:string">
<xs:enumeration value="OneMonth" />
<xs:enumeration value="ThreeMonth" />
<xs:enumeration value="SixMonth" />
<xs:enumeration value="OneYear" />
</xs:restriction>
</xs:simpleType>
<xs:element name="Period" type="mapsws:Period" />
<xs:complexType name="DatePeriod">
<xs:sequence>
<xs:element ref="mapsws:StartDate" />
<xs:element ref="mapsws:EndDate" />
<xs:element ref="mapsws:COB" />
</xs:sequence>
</xs:complexType>
<xs:element name="DatePeriod" type="mapsws:DatePeriod" />
<xs:complexType name="Security">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="sec" type="xs:string"
nillable="false" />
<xs:element minOccurs="1" maxOccurs="1" name="field"
type="xs:string" nillable="false" />
</xs:sequence>
</xs:complexType>
<xs:element name="Security" type="mapsws:Security" />
<xs:complexType name="SecurityData">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="sec" type="xs:string"
nillable="false" />
<xs:element minOccurs="1" maxOccurs="1" name="field"
type="xs:string" nillable="false" />
</xs:sequence>
</xs:complexType>
<xs:element name="SecurityData" type="mapsws:SecurityData" />
<xs:simpleType name="AggregateOps">
<xs:restriction base="xs:string">
<xs:enumeration value="Avg" />
<xs:enumeration value="Max" />
<xs:enumeration value="Min" />
</xs:restriction>
</xs:simpleType>
<xs:element name="AggregateOps" type="mapsws:AggregateOps" />
<xs:complexType name="YAxis">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" ref="mapsws:MarkerStep" />
<xs:element minOccurs="1" maxOccurs="1" ref="mapsws:Colors" />
<xs:element minOccurs="1" maxOccurs="1" ref="mapsws:LineStyle" />
<xs:element minOccurs="1" maxOccurs="1" ref="mapsws:Markers" />
<xs:element minOccurs="1" maxOccurs="1" ref="mapsws:Linewidth" />
<xs:element minOccurs="0" maxOccurs="1" ref="mapsws:Legend" />
<xs:element minOccurs="1" maxOccurs="1" ref="mapsws:Direction" />
<xs:element minOccurs="1" maxOccurs="1" name="tssecurity"
type="mapsws:Security" />
</xs:sequence>
</xs:complexType>
<xs:element name="YAxis" nillable="false" type="mapsws:YAxis" />
<xs:complexType name="ArrayYAxis">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="100" name="YSeries"
nillable="false" type="mapsws:YAxis" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="ConstantLine">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" ref="mapsws:Colors" />
<xs:element minOccurs="1" maxOccurs="1" ref="mapsws:LineStyle" />
<xs:element minOccurs="1" maxOccurs="1" ref="mapsws:Linewidth" />
<xs:element minOccurs="1" maxOccurs="1" ref="mapsws:Axis" />
<xs:element minOccurs="1" maxOccurs="1" ref="mapsws:AggregateOps" /
>
<xs:element minOccurs="1" maxOccurs="1" name="csecurity"
type="mapsws:Security" />
</xs:sequence>
</xs:complexType>
<xs:element name="ConstantLine" nillable="true"
type="mapsws:ConstantLine" />
<xs:complexType name="ArrayConstantLine">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="10" name="ConstantLines"
nillable="true" type="mapsws:ConstantLine" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="TimeSeriesElements">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="yseries"
type="mapsws:ArrayYAxis" />
<xs:element minOccurs="0" maxOccurs="1" name="period"
type="mapsws:Period" />
<xs:element minOccurs="0" maxOccurs="1" name="dateperiod"
type="mapsws:DatePeriod" />
<xs:element minOccurs="0" maxOccurs="1" name="frequency"
type="mapsws:Frequency" />
<xs:element minOccurs="0" maxOccurs="1" name="frequencyday"
type="mapsws:FrequencyDay" />
<xs:element minOccurs="0" maxOccurs="1" name="frequencymonth"
type="mapsws:FrequencyMonth" />
<xs:element minOccurs="0" maxOccurs="1"
ref="mapsws:ShowConstantLine" />
<xs:element minOccurs="0" maxOccurs="1" name="constantlines"
type="mapsws:ArrayConstantLine" />
</xs:sequence>
</xs:complexType>
<xs:element name="TimeSeriesElements" nillable="false"
type="mapsws:TimeSeriesElements" />
<xs:complexType name="TimeSeries">
<xs:complexContent>
<xs:extension base="mapsws:TimeSeriesElements">
<xs:attribute ref="mapsws:XTitle" use="optional" />
<xs:attribute ref="mapsws:YTitle" use="optional" />
<xs:attribute ref="mapsws:Y2Title" use="optional" />
<xs:attribute ref="mapsws:ChartTitle" use="optional" />
<xs:attribute ref="mapsws:YMin" />
<xs:attribute ref="mapsws:YMax" />
<xs:attribute ref="mapsws:Y2Min" />
<xs:attribute ref="mapsws:Y2Max" />
<xs:attribute ref="mapsws:Format" />
<xs:attribute ref="mapsws:Dec" />
<xs:attribute name="BoxColor" type="mapsws:Colors" use="optional" /
>
<xs:attribute name="BackColor" type="mapsws:Colors"
use="optional" />
<xs:attribute ref="mapsws:Height" />
<xs:attribute ref="mapsws:Width" />
<xs:attribute name="AppToken" type="xs:string" use="required" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="TimeSeries" nillable="false"
type="mapsws:TimeSeries" />
</xs:schema>
Date:Wed, 22 Aug 2007 02:10:39 -0000
Author:
|
Re: XML schema validation with web services
wowfed wrote:
> I'm getting following errors in my schema validation .
>
> Error Message: The 'TimeSeries' element is not declared. An error
> occurred at , (1, 2).
> The 'http://alx.ml.com/mapsws:BoxColor' attribute is not declared. An
> error occurred at , (1, 163).
>
> It would be great if some one could tell me what Im doing wrong. ?
> <?xml version="1.0" encoding="utf-8" ?>
> <TimeSeries d4p1:XTitle="Date" d4p1:YTitle=""
> d4p1:Y2Title="Y2" d4p1:YMin="auto" d4p1:YMax="100" d4p1:Y2Min="auto"
> d4p1:Y2Max="auto" d4p1:Format="1" d4p1:Dec="3"
> d4p1:BoxColor="Off_White" d4p1:BackColor="White" d4p1:AppToken="myapp"
> xmlns:d4p1="http://alx.ml.com/mapsws">
The root element TimeSeries needs to be in the target namespace
http://alx.ml.com/mapsws the schema defines. So you need e.g.
<TimeSeries xmlns="http://alx.ml.com/mapsws" ...>
or
<d4p1:TimeSeries xmlns:d4p1="http://alx.ml.com/mapsws" ...>
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Date:Wed, 22 Aug 2007 15:48:39 +0200
Author:
|
Re: XML schema validation with web services
On Aug 22, 9:48 am, Martin Honnen wrote:
> wowfed wrote:
> > I'm getting following errors in myschemavalidation .
>
> > Error Message: The 'TimeSeries' element is not declared. An error
> > occurred at , (1, 2).
> > The 'http://alx.ml.com/mapsws:BoxColor'attribute is not declared. An
> > error occurred at , (1, 163).
>
> > It would be great if some one could tell me what Im doing wrong. ?
> > <?xmlversion="1.0" encoding="utf-8" ?>
> > <TimeSeries d4p1:XTitle="Date" d4p1:YTitle=""
> > d4p1:Y2Title="Y2" d4p1:YMin="auto" d4p1:YMax="100" d4p1:Y2Min="auto"
> > d4p1:Y2Max="auto" d4p1:Format="1" d4p1:Dec="3"
> > d4p1:BoxColor="Off_White" d4p1:BackColor="White" d4p1:AppToken="myapp"
> > xmlns:d4p1="http://alx.ml.com/mapsws">
>
> The root element TimeSeries needs to be in the target namespacehttp://alx.ml.com/mapswstheschemadefines. So you need e.g.
> <TimeSeries xmlns="http://alx.ml.com/mapsws" ...>
> or
> <d4p1:TimeSeries xmlns:d4p1="http://alx.ml.com/mapsws" ...>
>
> --
>
> Martin Honnen --- MVPXML
> http://JavaScript.FAQTs.com/
Thanks a lot Martin. That worked like a charm. But the xml I posted
was taken out of the raw soap msg submitted in the web service
request. Timeseries element didn't have the namespace alias in the
soap msg .I have no clue how web service request was able to process
the request.
Date:Wed, 22 Aug 2007 19:34:10 -0700
Author:
|
|
|