Author |
Message
|
reshds |
Posted: Mon Sep 13, 2010 3:32 pm Post subject: Question regarding shema validation. |
|
|
 Apprentice
Joined: 25 Mar 2010 Posts: 37 Location: LA
|
Hi
Iam using WebSphere Message Brokers Toolkit - Message Broker
Version: 6.0.2
I have a question regarding shema validation.
<xs:element name="DummyVIN" nillable="true" minOccurs="0"> <xs:simpleType>
<xs:restriction base="xs:string">
<xs:Length value="15"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
It suppose to throw an error If I pass a string which length is greater than 15 charector But above code is not throwing any error If I pass 17 digit DummyVIN
Thanks in advance. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Sep 13, 2010 4:05 pm Post subject: Re: Question regarding shema validation. |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
reshds wrote: |
It suppose to throw an error If I pass a string which length is greater than 15 charector But above code is not throwing any error If I pass 17 digit DummyVIN |
How do you know? How have you presented the schema to the broker? How have you performed the validation of the XML against the schema? How do you know there was no error? What does the user trace show? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
reshds |
Posted: Mon Sep 13, 2010 4:40 pm Post subject: |
|
|
 Apprentice
Joined: 25 Mar 2010 Posts: 37 Location: LA
|
Quote: |
How do you know? How have you presented the schema to the broker? How have you performed the validation of the XML against the schema? How do you know there was no error? What does the user trace show? |
I have run this in the broker and I was expecting It should fail since I pass 17 charator DummyVIN and the restriction is Length value="15"
Quote: |
How have you performed the validation of the XML against the schema? |
How to do this validation .Is there any plugin availble in the MB or use xmlspy? |
|
Back to top |
|
 |
Vitor |
Posted: Mon Sep 13, 2010 4:47 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
reshds wrote: |
Quote: |
How do you know? How have you presented the schema to the broker? How have you performed the validation of the XML against the schema? How do you know there was no error? What does the user trace show? |
I have run this in the broker and I was expecting It should fail since I pass 17 charator DummyVIN and the restriction is Length value="15" |
I repeat my questions - why should it fail? What did you do to make the broker do the validation? It's especially important (as a general error resolution principle) to see what the user trace says.
reshds wrote: |
Quote: |
How have you performed the validation of the XML against the schema? |
How to do this validation .Is there any plugin availble in the MB or use xmlspy? |
Well most people use the validation facilities built into WMB and described in the documentation. It's a new one to expect WMB to use XMLSpy; I would imagine WMB would have trouble using the mouse to click on XMLSpy's menu options......
So again I ask - how have you performed the validation of the XML against the schema in broker? What have you done to make WMB throw an error if the XML doesn't match the schema? I'm guessing it's more than just write the schema file onto the same disc as the broker??? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
reshds |
Posted: Mon Sep 13, 2010 4:58 pm Post subject: |
|
|
 Apprentice
Joined: 25 Mar 2010 Posts: 37 Location: LA
|
Quote: |
I repeat my questions - why should it fail? What did you do to make the broker do the validation? It's especially important (as a general error resolution principle) to see what the user trace says. |
I do Not know how to valdiate the schema in the Broker.There is no user trace and I am getting the output.But I want to do the schema validation and make sure that lenght which is greater that 15 should not be validated and throw some exception.Pleas tell me how to do that. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Sep 13, 2010 5:07 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
reshds wrote: |
I do Not know how to valdiate the schema in the Broker. |
Well there's your problem in trying to get broker to validate against the schema.
reshds wrote: |
There is no user trace |
No, I was suggesting you take a user trace to assist with problem solving.
reshds wrote: |
But I want to do the schema validation and make sure that lenght which is greater that 15 should not be validated and throw some exception. |
And there was me thinking you just wanted to frame the schema and admire it.
reshds wrote: |
Pleas tell me how to do that. |
You should start by getting some training. This is very, very basic stuff in broker. You're going to struggle if this seems hard.
You should also consider using the product documentation. I typed "schema validation" in the the InfoCentre search and got this. You'll notice it's titled "Validating an XML message against a schema", which I'd have thought might have caught your eye even if the search facility eluded you.
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
reshds |
Posted: Mon Sep 13, 2010 5:27 pm Post subject: |
|
|
 Apprentice
Joined: 25 Mar 2010 Posts: 37 Location: LA
|
Its good that you are not showing your face...
I wanted to check whether its configured or not in an existing application.
validation in the output is already set as "Inherit" . still why its not validating?
Thanks... |
|
Back to top |
|
 |
Vitor |
Posted: Mon Sep 13, 2010 5:31 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
reshds wrote: |
Its good that you are not showing your face...  |
My wife says the same thing. My co-workers claim it's an excellent likeness.
reshds wrote: |
I wanted to check whether its configured or not in an existing application. |
Then the link I provided will be invaluable.
reshds wrote: |
validation in the output is already set as "Inherit" . still why its not validating? |
For the reasons given in the documentation. You will also find a user trace illuminating. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Sep 13, 2010 5:51 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Your xsd does validate. Remember you set Length=15. If you wanted to limit that you should have said something like MaxLength=15.
Yes it matters.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
reshds |
Posted: Mon Sep 13, 2010 6:21 pm Post subject: |
|
|
 Apprentice
Joined: 25 Mar 2010 Posts: 37 Location: LA
|
Quote: |
Your xsd does validate. Remember you set Length=15. If you wanted to limit that you should have said something like MaxLength=15. |
There is a check box in the Message set which says "Broker will treat Length as MaxLength" .and which is checked so I dont need to explicitly set MaxLength . right??
.Currently validation in the HTTP Reply is set as "Inherit",What I need to do/change inorder to validate the output xml against schema. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Sep 13, 2010 7:12 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
reshds wrote: |
Quote: |
Your xsd does validate. Remember you set Length=15. If you wanted to limit that you should have said something like MaxLength=15. |
There is a check box in the Message set which says "Broker will treat Length as MaxLength" .and which is checked so I dont need to explicitly set MaxLength . right?? |
Why? Cite your examples?
reshds wrote: |
.Currently validation in the HTTP Reply is set as "Inherit",What I need to do/change inorder to validate the output xml against schema. |
What does the documentation say? What have you checked? |
|
Back to top |
|
 |
kimbert |
Posted: Mon Sep 13, 2010 11:46 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
reshds : You need to switch on validation in your message flow. Please read the link that Vitor provided to find out how to do that.
Tip: You are not liklely to get a sensible answer until you have read the relevant topics in the infocenter. If you cannot understand the infocenter, feel free to ask another question - but please tell us which topics you did not understand so that we can improve them. |
|
Back to top |
|
 |
|