We have an xsd schema that outlines all the possible data elements in our system, some are simple type elements and some are complex types. We gave this schema to another developer who will try to write up a web service using SOAP. The xsd in a dumb down sample looks like this.
<xs:element name="Element1"> .... </xs:element>
<xs:element name="Element2"> .... </xs:element>
<xs:element name="Element3"> .... </xs:element>
<xs:element name="Element4"> .... </xs:element>
I plan to send our data to him by calling his WebService method. Due to the type of message generated from my system, I will have two type of messages. The first one contains Element1 and Element4 only while the second type may contains Element3, Element4 and Element1. So what are the choice does he have here?
- Does he have to create two separate web services and I'll consume them accordingly?
- Create one web service and I'll consume that one web service for both of my message types.
In the second opotion, does it generate any schema validation error? if so is there a way to get around it? can I send him a custom SOAP header to indicates the message type I send so he can validates it against specific xsd elements?
I'm relatively new to WebService so if I misunderstood the the basic mechanism of SOAP, XSD and WebService please feel free to point them out or correct any of my above assumptions.