Author |
Message
|
alapati |
Posted: Sun Apr 08, 2012 11:21 pm Post subject: parsing error |
|
|
Newbie
Joined: 08 Apr 2012 Posts: 9
|
I need to test my flow with sample message provided by my client.but that sample message doesn't having name space. so i getting exception as xml parsing errors have occurred when trying to validate the message. |
|
Back to top |
|
 |
mapa |
Posted: Mon Apr 09, 2012 12:47 am Post subject: |
|
|
 Master
Joined: 09 Aug 2001 Posts: 257 Location: Malmö, Sweden
|
Is the XML well-formed?
Verify that first.
Then provide more details so your question is understandable and possible to answer. |
|
Back to top |
|
 |
alapati |
Posted: Mon Apr 09, 2012 1:03 am Post subject: |
|
|
Newbie
Joined: 08 Apr 2012 Posts: 9
|
Ya Xml is well formed . am using xmlnsc as a domain parser and using related xsd only. when giving validate option as content and value or content then only its getting exception. if anything else please let me know. |
|
Back to top |
|
 |
mapa |
Posted: Mon Apr 09, 2012 1:32 am Post subject: |
|
|
 Master
Joined: 09 Aug 2001 Posts: 257 Location: Malmö, Sweden
|
OK, that is more precis information.
If you don't use the validation the broker parse the message fine then?
Using the toolkit you can validate a XML file against its schema. What does it say if you try that?
What parser exception does the broker report? |
|
Back to top |
|
 |
alapati |
Posted: Mon Apr 09, 2012 1:45 am Post subject: |
|
|
Newbie
Joined: 08 Apr 2012 Posts: 9
|
Ya without using validation/validate option as none then xml is parsed successfully.
xml file against its schema means test the xml with another schema file which is not related to this? |
|
Back to top |
|
 |
mapa |
Posted: Mon Apr 09, 2012 3:06 am Post subject: |
|
|
 Master
Joined: 09 Aug 2001 Posts: 257 Location: Malmö, Sweden
|
No, you have one or more XSD already.
Use them in the toolkit, don't remember if you need to also switch eclipse perspective as well. Right click on the opened file and choose validate.
You must probably associate it with your schema first, don't remember if there is a menu option for that. Otherwise just add a xsi schema location. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Apr 09, 2012 4:40 am Post subject: Re: parsing error |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
alapati wrote: |
I need to test my flow with sample message provided by my client.but that sample message doesn't having name space. so i getting exception as xml parsing errors have occurred when trying to validate the message. |
WMB can validate an XML document with no namespace with the XMLNSC domain. I'm looking at a flow that does that now.
If you mean that the sample supplied by your client doesn't have a namespace but the schema does, then WMB is right - the XML is invalid in that it doesn't match the schema.
If that's not what you mean take a user trace & see why WMB thinks the document is invalid. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kimbert |
Posted: Mon Apr 09, 2012 8:44 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Please quote the error message - in full. It's very hard to help without knowing what the problem is. |
|
Back to top |
|
 |
alapati |
Posted: Mon Apr 09, 2012 9:35 pm Post subject: |
|
|
Newbie
Joined: 08 Apr 2012 Posts: 9
|
Yes, the sample doesn't have a namespace but the schema does.So how can add a namespace to that sampe xml? |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Apr 09, 2012 9:47 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
alapati wrote: |
Yes, the sample doesn't have a namespace but the schema does.So how can add a namespace to that sampe xml? |
go back to your client and tell them that the XML they have provided DOES NOT MATCH The Schema.
If they insist it is correct then get a signed waiver to this effect and move on. Don't validate against a schema you know to be faulty.
OR
You could change the schema to remove the namespace.
I'd also keep the existing schema/messageset around so that when the customer realises what they have done and they start sending you 'good' data you can swap the messageSets over and continue as if nothing happened with a 'I'm a really Smug Git' smile on your face. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Apr 10, 2012 4:38 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
alapati wrote: |
Yes, the sample doesn't have a namespace but the schema does.So how can add a namespace to that sampe xml? |
You could try XMLSpy or any other XML editor?
So how do you know that live XML will not omit the namespace as well? How do you know the schema shouldn't in fact have a namespace? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mapa |
Posted: Tue Apr 10, 2012 4:59 am Post subject: |
|
|
 Master
Joined: 09 Aug 2001 Posts: 257 Location: Malmö, Sweden
|
alapati wrote: |
Yes, the sample doesn't have a namespace but the schema does.So how can add a namespace to that sampe xml? |
Lots of guessing.
No namespace or just no namespace prefix but a default namespace? |
|
Back to top |
|
 |
|