XFireHome M5M6-SNAPSHOTDevelopersDeveloper Space |
This page attempts to cover basic versioning patterns in web services. A lot of these patterns can be mixed and matched to provide the best combination. No Version PatternDescription: Some people may choose to not worry about versioining at all. While, not strictly a versioning pattern, it is helpful to mention this to know the upsides and downsides. Pros: Easy. Namespace PatternDescription: Namespaces can be used to determine different type versions. Your first service revision may have a target namespace of "urn:company:service:v1" and each subsequent major revision will have an increased version number. Knowing the version of your xml documents, will tell you which version of the service to invoke. Example: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" <soap:Body> <Price xmlns="urn:company:service:v1">3.333333</Price> </soap:Body> </soap:Envelope> New Version <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" <soap:Body> <Price xmlns="urn:company:service:v2">3.33</Price> </soap:Body> </soap:Envelope> Because of the namespace change you know that the first request is still acceptable even though it doesn't conform to your latest schema. Services following this pattern: Amazon
Version Parameter PatternDescription: Including a version number in the request will help you determine how to process the request and what kind of response to return. Examples: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" <soap:Header> <Version xmlns="urn:company:service">340</Version> </soap:Header> <soap:Body> .... </soap:Body> </soap:Envelope> Example 2 (Body): <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" <soap:Body> <SomeRequest xmlns="urn:company:service"> <Version>340</Version> .... </SomeRequest> </soap:Body> </soap:Envelope> Services following this pattern: eBay (header) New Endpoint PatternDescription: The new endpoint pattern is very close to the version paramter pattern. The only difference is that instead of putting the version being accessed into the request, it becomes part of the URL being invoked. Example: http://example.com/service/v1 http://example.com/service/v2 Services following this pattern: JIRA? |