Hi Ryan, When you arbitrarily add more data to the XML content of an existing service you're breaking the service contract, in that messages using the new content will not be valid according to the older schemas.
If you want to allow this type of flexibility on the service end you've got two choices. The first approach is to define extension points in your XML schema structure, using xs:any elements. When you use xs:any as part of your schema definition you give yourself the flexibility to add more (optional) elements in the future without breaking clients developed using the current schema. This is the recommended approach in general, since it preserves the service contract. The second approach is to just add the elements in and hope your clients are using a sloppy form of XML handling that ignores unexpected elements. JAXB is probably the sloppiest of the Java data binding technologies, so if you use JAXB on your client you should be ok with this kind of change. Proper schema design for web services, and designing the services themselves for extensibility, are complex topics. I do provide classes covering these topics, in case anyone is interested... - Dennis Dennis M. Sosnoski Java SOA and Web Services Consulting <http://www.sosnoski.com/consult.html> Axis2/CXF/Metro SOA and Web Services Training <http://www.sosnoski.com/training.html> Web Services Jump-Start <http://www.sosnoski.com/jumpstart.html> On 03/01/2011 03:33 AM, Ryan Bergman wrote: > Hi, I have a soap web service served from a .net app. Sometimes we add > fields to some of the objects but these are always optional and from a > XML/HTTP standpoint the xml tags that represent those fields could be > left out and it works fine. (like say we have user with a firstname > and lastname and we add middle name). This should let existing users > of the web services keep working. > > and this is exactly how it does work for almost everyone. Clients > using .net, python, ruby etc all have no problem with this. But any > change at all seems to break anyone using Axis. > > It seems that on every request Axis checkes the endpoints WSDL and > verifies that it is EXACTLY like the stubs it has. If not then it > throws an exception (unexpected subelement). > > Our clients are very frustrated with this because they have to get a > developer to regenerate the stubs every time we add something (and > they often do not care about the addition). Our product management is > frustrated because they have to give our clients 2 months warning > before they add a field (again...just it seems for clients using > axis). Our customer support is frustrated because the clients don't > listen to our warnings and then after the release they get angry calls > rom the customers because the web services are broken. > > Is there any simple option in Axis to turn this feature off and have > Axis just assume it's current stubs are correct? If not is this > planned for the future? > > Thanks > Ryan Bergman > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
