Hey all, New to SOAP... What I'd like to do is validate that the XML in the soap header has all the elements I need in the correct sequence. I'd also like to validate that the xml within the soap body has all the elements I need in the correct sequence. My SOAP document looks like:
Should I create an XSD for just the XML within the SOAP body? Is it possible to create an XSD to validate that the <SOAP:Header> contains all the required elements in the correct sequence? John
Christophe Grosjean
Ranch Hand
Joined: Jan 22, 2002
Posts: 51
posted
0
I'm not sure to understand clearly your needs. If you want to validate only your SOAP header, you can define an XSD for the whole document, specifying that <soap:envelope> is an element containing a <soap:header> (which you fully specify in the xsd) and any other element (corresponding to your body) with <xsd:any/> in your schema
John Fairbairn
Ranch Hand
Joined: May 30, 2002
Posts: 55
posted
0
Hi Christophe, I want to validate the entire SOAP document. I'll explain my problem more clearly. I created the following SOAP document:
I used XML Spy to generate a schema for me given this xml. The generated schema looked like:
When I try saving the schema, I get an error:
SOAP:BodyType cannot have a namespace prefix. Please remove prefix or use ref=instead!
How do I reference the SOAP namespace in my XSD? Can you reference a namespace in the name attribute of an element? Thanks for your help. John
John Fairbairn
Ranch Hand
Joined: May 30, 2002
Posts: 55
posted
0
Hi Christophe, I want to validate the entire SOAP document. I'll explain my problem more clearly. I created the following SOAP document:
I used XML Spy to generate a schema for me given this xml. The generated schema looked like:
When I try saving the schema, I get an error:
SOAP:BodyType cannot have a namespace prefix. Please remove prefix or use ref=instead!
How do I reference the SOAP namespace in my XSD? Can you reference a namespace in the name attribute of an element? Thanks for your help. John
Christophe Grosjean
Ranch Hand
Joined: Jan 22, 2002
Posts: 51
posted
0
simply add : xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/ to the tag <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> of your xsd file. Christophe
John Fairbairn
Ranch Hand
Joined: May 30, 2002
Posts: 55
posted
0
Hi Christophe, Thanks for your reply. I tried adding the new namespace so my xsd now looks like:
When saving, I still get the error:
SOAP:BodyType cannot have a namespace prefix. Please remove prefix or use ref=instead!
Not sure why it does not recognize the namespace.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.