473,756 Members | 5,660 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Best place to use AND how to validate a Version

I am using the "contract first" design methodology. Contract First is design
the WSDL first then design the server and client. However I must design my
XSD/XML Schema before anything.

I am developing my schema now. I have a version on my schema. However once
I start the server side code, how is the server now that the right
"complexTyp e" is being passed?

What happens if this complexType my web service consumes needs to be
different. Should every "complexTyp e" in my message have "schemaVers ion"
element that is non-null, and check that everytime the Web Service is
generated.

OR

I also design my messages in the XML Schema. Should I check the version in
the SOAP Header?

Thanks for your input.
--
Mike Logan
Nov 23 '05 #1
10 1986
Hi Mike,

For the Xml Types we defined in Xml schemas for webservice's data type or
WSDL's message element type, they're all identified and scoped by xml
namespace. So generally, for the xml data types and message element types,
we will scope them under the sample namespace(or same root namespace....)
for example:

we can define the root namespace of our webservice as:

http://myservice/

and the xml schema can use a sub namespace like:

http://myservice/datatypes

wsdl message types can use

http://myservice/contract

as namespace. There is no version info for xml types, just use XML
namespace to identify their scope. Also, at runtime, the webservice engine
, e.g the ASP.NET webservice handler will parse the xml content and mapping
the xml data to types through namespace. So when you need to define new
version of the datatypes, you can just define a new schema or other xml
data with new namespace....

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
Thread-Topic: Best place to use AND how to validate a Version
thread-index: AcXaWtvmrp2mLja LShOjAyVQmdWyMg ==
X-WBNR-Posting-Host: 165.176.240.10
From: "=?Utf-8?B?TWlrZSBMb2d hbg==?=" <Mi*******@comm unity.nospam>
Subject: Best place to use AND how to validate a Version
Date: Wed, 26 Oct 2005 11:27:02 -0700
Lines: 21
Message-ID: <00************ *************** *******@microso ft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
microsoft.publi c.dotnet.framew ork.webservices :8365
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.webservices

I am using the "contract first" design methodology. Contract First is
design
the WSDL first then design the server and client. However I must design my
XSD/XML Schema before anything.

I am developing my schema now. I have a version on my schema. However once
I start the server side code, how is the server now that the right
"complexTyp e" is being passed?

What happens if this complexType my web service consumes needs to be
different. Should every "complexTyp e" in my message have "schemaVers ion"
element that is non-null, and check that everytime the Web Service is
generated.

OR

I also design my messages in the XML Schema. Should I check the version in
the SOAP Header?

Thanks for your input.
--
Mike Logan

Nov 23 '05 #2
Hi Steven and Mike

Sorry for inteferring your thread but..

I don't know if it is considered "bad practice", but one could also
embed versioninfo in the XML namespace as:

http://myservice/datatypes/customer/10
for version 1.0 of the customer datatype

and http://myservice/datatypes/customer/11
for the version 1.1 of the customer datatype

Similar approach could be taken with the contracts.

Anyway. Are there any drawbacks with this approach?
One thing maybe.. A 1.0 client proxy will no be able to "talk" to a 1.1
Webservice, will it?

Isn't it right that Indigo deal with this, as there can be many
"contracts" assigned to a single service?

Looking forward to hear your insights.

Regards

Henrik

Steven Cheng[MSFT] wrote:
Hi Mike,

For the Xml Types we defined in Xml schemas for webservice's data type or
WSDL's message element type, they're all identified and scoped by xml
namespace. So generally, for the xml data types and message element types,
we will scope them under the sample namespace(or same root namespace....)
for example:

we can define the root namespace of our webservice as:

http://myservice/

and the xml schema can use a sub namespace like:

http://myservice/datatypes

wsdl message types can use

http://myservice/contract

as namespace. There is no version info for xml types, just use XML
namespace to identify their scope. Also, at runtime, the webservice engine
, e.g the ASP.NET webservice handler will parse the xml content and mapping
the xml data to types through namespace. So when you need to define new
version of the datatypes, you can just define a new schema or other xml
data with new namespace....

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 23 '05 #3
Welcome Henrick and thanks for your inputs.

I think the things you mentioned is just I've also involved in my reply.
for XML data types, they're defined by xml schema(xsd.. ). And unlike the
programming source code/ or assemblies which can have version info. The Xml
data types use namespace to identify a certain collection of data, so
namespace is a buildin feature for providing version info. In fact, we can
find many realworld example like the SOAP 1.1 and SOAP 1.2's schema

SOAP 1.1

http://schemas.xmlsoap.org/soap/envelope/
SOAP 1.2

http://www.w3.org/2001/12/soap-envelope

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
Date: Thu, 27 Oct 2005 08:03:46 +0200
From: =?ISO-8859-1?Q?Henrik_G=F8 ttig?= <hg@websolver.d k>
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Subject: Re: Best place to use AND how to validate a Version
References: <00************ *************** *******@microso ft.com>
<HY************ **@TK2MSFTNGXA0 1.phx.gbl>
In-Reply-To: <HY************ **@TK2MSFTNGXA0 1.phx.gbl>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <u9************ **@TK2MSFTNGP09 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
NNTP-Posting-Host: 194.239.230.244
Lines: 1
Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP09.phx. gbl
microsoft.publi c.dotnet.framew ork.webservices :8371
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.webservices

Hi Steven and Mike

Sorry for inteferring your thread but..

I don't know if it is considered "bad practice", but one could also
embed versioninfo in the XML namespace as:

http://myservice/datatypes/customer/10
for version 1.0 of the customer datatype

and http://myservice/datatypes/customer/11
for the version 1.1 of the customer datatype

Similar approach could be taken with the contracts.

Anyway. Are there any drawbacks with this approach?
One thing maybe.. A 1.0 client proxy will no be able to "talk" to a 1.1
Webservice, will it?

Isn't it right that Indigo deal with this, as there can be many
"contracts" assigned to a single service?

Looking forward to hear your insights.

Regards

Henrik

Steven Cheng[MSFT] wrote:
Hi Mike,

For the Xml Types we defined in Xml schemas for webservice's data type or WSDL's message element type, they're all identified and scoped by xml
namespace. So generally, for the xml data types and message element types, we will scope them under the sample namespace(or same root namespace....) for example:

we can define the root namespace of our webservice as:

http://myservice/

and the xml schema can use a sub namespace like:

http://myservice/datatypes

wsdl message types can use

http://myservice/contract

as namespace. There is no version info for xml types, just use XML
namespace to identify their scope. Also, at runtime, the webservice engine , e.g the ASP.NET webservice handler will parse the xml content and mapping the xml data to types through namespace. So when you need to define new
version of the datatypes, you can just define a new schema or other xml
data with new namespace....

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Nov 23 '05 #4
Hi Guys,

This is such a nice topic i couldn't resist putting my 2ct. in ;-)

The versioning scheme suggested by Henrik is a very common one. You
essentially have the following options;

- Modify your namespace-uri for different versions (*the example
below)
This is a very strict way of versioning. The problem is that for each
new version your clients will have to "update reference & recompile".

- include version attribute in your schema
This is how it was intended, but i no of NONE XML-XSD parser that will
actually read/use the version attribute and be able to have multiple
versions of the same schema.

Please be aware that when you are developing a WebService with .Net
(same goes for Axis AFAIK) that;

- XSD Validation on the incomming message is NOT THERE by default.
- The deserialization happens with "Defaults" (i.e. an element that is
not found will be filled with ; 0 for numbers, "" for strings, etc)
- The .Net types representing the XSD complextypes are not 100% XSD
equivilant. (You loose the facets in the .Net type, like
'maxInclusive', maxLength, etc)

Hope this helps,

Marvin Smit.
On Thu, 27 Oct 2005 08:03:46 +0200, Henrik Gøttig <hg@websolver.d k>
wrote:
Hi Steven and Mike

Sorry for inteferring your thread but..

I don't know if it is considered "bad practice", but one could also
embed versioninfo in the XML namespace as:

http://myservice/datatypes/customer/10
for version 1.0 of the customer datatype

and http://myservice/datatypes/customer/11
for the version 1.1 of the customer datatype

Similar approach could be taken with the contracts.

Anyway. Are there any drawbacks with this approach?
One thing maybe.. A 1.0 client proxy will no be able to "talk" to a 1.1
Webservice, will it?

Isn't it right that Indigo deal with this, as there can be many
"contracts" assigned to a single service?

Looking forward to hear your insights.

Regards

Henrik

Steven Cheng[MSFT] wrote:
Hi Mike,

For the Xml Types we defined in Xml schemas for webservice's data type or
WSDL's message element type, they're all identified and scoped by xml
namespace. So generally, for the xml data types and message element types,
we will scope them under the sample namespace(or same root namespace....)
for example:

we can define the root namespace of our webservice as:

http://myservice/

and the xml schema can use a sub namespace like:

http://myservice/datatypes

wsdl message types can use

http://myservice/contract

as namespace. There is no version info for xml types, just use XML
namespace to identify their scope. Also, at runtime, the webservice engine
, e.g the ASP.NET webservice handler will parse the xml content and mapping
the xml data to types through namespace. So when you need to define new
version of the datatypes, you can just define a new schema or other xml
data with new namespace....

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 23 '05 #5
Hi Marvin (and Steven and Mike and ???)

Thanx for joining in and it is indeed a nice topic :-)

Do you know if the question I asked about Indigo applies?
Will Indigo deal with versioning in the way, that you can several
contracts (message and datatypes) applied to the very same service?

So one could say, that this service supports version 1 and version 2 of
the contract.

I think this is one of the most under-documented "problems" of using the
web services stack. ANYONE dealing with web services in production WILL
face this issue at some point in time.
I have seen others apply "the new service approach", where a change of
contract (in an exsting message and/or datatype) results in creating a
new branch of the same service just a another endpoint.

Regards

Henrik

Marvin Smit wrote:
Hi Guys,

This is such a nice topic i couldn't resist putting my 2ct. in ;-)

The versioning scheme suggested by Henrik is a very common one. You
essentially have the following options;

- Modify your namespace-uri for different versions (*the example
below)
This is a very strict way of versioning. The problem is that for each
new version your clients will have to "update reference & recompile".

- include version attribute in your schema
This is how it was intended, but i no of NONE XML-XSD parser that will
actually read/use the version attribute and be able to have multiple
versions of the same schema.

Please be aware that when you are developing a WebService with .Net
(same goes for Axis AFAIK) that;

- XSD Validation on the incomming message is NOT THERE by default.
- The deserialization happens with "Defaults" (i.e. an element that is
not found will be filled with ; 0 for numbers, "" for strings, etc)
- The .Net types representing the XSD complextypes are not 100% XSD
equivilant. (You loose the facets in the .Net type, like
'maxInclusive', maxLength, etc)

Hope this helps,

Marvin Smit.

Nov 23 '05 #6
Hi Marvin,

Thanks for your good inputs.
I agree with the things you mentioned. Also as for the below:

===========
- The .Net types representing the XSD complextypes are not 100% XSD
equivilant. (You loose the facets in the .Net type, like
'maxInclusive', maxLength, etc)
============

Yes, .NET type(with xml serliazation attribute) can not 100% express what
XSD can do. However, we can accomplish some of those rules in XSD through
programming language's code logic. e.g. the
'maxInclusive', maxLength, etc)

can be done through code validtion in the property's get/set accessor....
and that's also why we use .NET type mapping.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--------------------
From: Marvin Smit <ma*********@gm ail.com>
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
Subject: Re: Best place to use AND how to validate a Version
Date: Thu, 27 Oct 2005 10:06:00 +0200
Message-ID: <54************ *************** *****@4ax.com>
References: <00************ *************** *******@microso ft.com>
<HY************ **@TK2MSFTNGXA0 1.phx.gbl>
<u9************ **@TK2MSFTNGP09 .phx.gbl>
X-Newsreader: Forte Free Agent 3.0/32.763
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Complaints-To: ab***@chello.nl
Organization: chello.nl
Lines: 102
NNTP-Posting-Host: 62.194.138.116 (62.194.138.116 )
NNTP-Posting-Date: Thu, 27 Oct 2005 10:03:21 +0200
X-Trace: d55ff436089c99b 672fd116176
Path:
TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!ne wsfeed00.sul.t-online.de!newsf e
ed01.sul.t-online.de!t-online.de!newsf eed01.chello.at !amsnews01.chel lo.com!a
msnews14.chello .com!news.chell o.nl.POSTED!not-for-mail
microsoft.publi c.dotnet.framew ork.webservices :8377
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.webservices

Hi Guys,

This is such a nice topic i couldn't resist putting my 2ct. in ;-)

The versioning scheme suggested by Henrik is a very common one. You
essentially have the following options;

- Modify your namespace-uri for different versions (*the example
below)
This is a very strict way of versioning. The problem is that for each
new version your clients will have to "update reference & recompile".

- include version attribute in your schema
This is how it was intended, but i no of NONE XML-XSD parser that will
actually read/use the version attribute and be able to have multiple
versions of the same schema.

Please be aware that when you are developing a WebService with .Net
(same goes for Axis AFAIK) that;

- XSD Validation on the incomming message is NOT THERE by default.
- The deserialization happens with "Defaults" (i.e. an element that is
not found will be filled with ; 0 for numbers, "" for strings, etc)
- The .Net types representing the XSD complextypes are not 100% XSD
equivilant. (You loose the facets in the .Net type, like
'maxInclusive', maxLength, etc)

Hope this helps,

Marvin Smit.
On Thu, 27 Oct 2005 08:03:46 +0200, Henrik Gøttig <hg@websolver.d k>
wrote:
Hi Steven and Mike

Sorry for inteferring your thread but..

I don't know if it is considered "bad practice", but one could also
embed versioninfo in the XML namespace as:

http://myservice/datatypes/customer/10
for version 1.0 of the customer datatype

and http://myservice/datatypes/customer/11
for the version 1.1 of the customer datatype

Similar approach could be taken with the contracts.

Anyway. Are there any drawbacks with this approach?
One thing maybe.. A 1.0 client proxy will no be able to "talk" to a 1.1
Webservice, will it?

Isn't it right that Indigo deal with this, as there can be many
"contracts" assigned to a single service?

Looking forward to hear your insights.

Regards

Henrik

Steven Cheng[MSFT] wrote:
Hi Mike,

For the Xml Types we defined in Xml schemas for webservice's data type or WSDL's message element type, they're all identified and scoped by xml
namespace. So generally, for the xml data types and message element types, we will scope them under the sample namespace(or same root namespace....) for example:

we can define the root namespace of our webservice as:

http://myservice/

and the xml schema can use a sub namespace like:

http://myservice/datatypes

wsdl message types can use

http://myservice/contract

as namespace. There is no version info for xml types, just use XML
namespace to identify their scope. Also, at runtime, the webservice engine , e.g the ASP.NET webservice handler will parse the xml content and mapping the xml data to types through namespace. So when you need to define new
version of the datatypes, you can just define a new schema or other xml
data with new namespace....

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Nov 23 '05 #7
Just a followup:

I like the idea of using versions in the namespace. However, Steven, in
your example, the datatypes schema was seperate from the message schema. If
you are on say:

"http://mywebservice/datatypes/2005/10/27", and
"http://mywebservice/contract/2005/10/27"

then change to

"http://mywebservice/datatypes/2005/12/5". If this happens I should also
have to change my contract/message schema, correct?

Is there a place that documents "Best Practices" for this? I was initially
defining datatypes and messages in the same schema. I would assume that is
alright for a small system?

Thanks for the help.
--
Mike Logan
"Marvin Smit" wrote:
Hi Guys,

This is such a nice topic i couldn't resist putting my 2ct. in ;-)

The versioning scheme suggested by Henrik is a very common one. You
essentially have the following options;

- Modify your namespace-uri for different versions (*the example
below)
This is a very strict way of versioning. The problem is that for each
new version your clients will have to "update reference & recompile".

- include version attribute in your schema
This is how it was intended, but i no of NONE XML-XSD parser that will
actually read/use the version attribute and be able to have multiple
versions of the same schema.

Please be aware that when you are developing a WebService with .Net
(same goes for Axis AFAIK) that;

- XSD Validation on the incomming message is NOT THERE by default.
- The deserialization happens with "Defaults" (i.e. an element that is
not found will be filled with ; 0 for numbers, "" for strings, etc)
- The .Net types representing the XSD complextypes are not 100% XSD
equivilant. (You loose the facets in the .Net type, like
'maxInclusive', maxLength, etc)

Hope this helps,

Marvin Smit.
On Thu, 27 Oct 2005 08:03:46 +0200, Henrik Gøttig <hg@websolver.d k>
wrote:
Hi Steven and Mike

Sorry for inteferring your thread but..

I don't know if it is considered "bad practice", but one could also
embed versioninfo in the XML namespace as:

http://myservice/datatypes/customer/10
for version 1.0 of the customer datatype

and http://myservice/datatypes/customer/11
for the version 1.1 of the customer datatype

Similar approach could be taken with the contracts.

Anyway. Are there any drawbacks with this approach?
One thing maybe.. A 1.0 client proxy will no be able to "talk" to a 1.1
Webservice, will it?

Isn't it right that Indigo deal with this, as there can be many
"contracts" assigned to a single service?

Looking forward to hear your insights.

Regards

Henrik

Steven Cheng[MSFT] wrote:
Hi Mike,

For the Xml Types we defined in Xml schemas for webservice's data type or
WSDL's message element type, they're all identified and scoped by xml
namespace. So generally, for the xml data types and message element types,
we will scope them under the sample namespace(or same root namespace....)
for example:

we can define the root namespace of our webservice as:

http://myservice/

and the xml schema can use a sub namespace like:

http://myservice/datatypes

wsdl message types can use

http://myservice/contract

as namespace. There is no version info for xml types, just use XML
namespace to identify their scope. Also, at runtime, the webservice engine
, e.g the ASP.NET webservice handler will parse the xml content and mapping
the xml data to types through namespace. So when you need to define new
version of the datatypes, you can just define a new schema or other xml
data with new namespace....

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 23 '05 #8
Hi Mike,

Of course, we can defining datatypes and messages in the same schema.
Actually there is no definite rules on this. If you need to adopt some best
practice, you may try searching some existing webservice contracts/types
schema on the net and get some ideas from them.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
Thread-Topic: Best place to use AND how to validate a Version
thread-index: AcXa5HfN7e4LdWi CSDyZuPNob21Ngg ==
X-WBNR-Posting-Host: 165.176.240.10
From: "=?Utf-8?B?TWlrZSBMb2d hbg==?=" <Mi*******@comm unity.nospam>
References: <00************ *************** *******@microso ft.com>
<HY************ **@TK2MSFTNGXA0 1.phx.gbl>
<u9************ **@TK2MSFTNGP09 .phx.gbl>
<54************ *************** *****@4ax.com>
Subject: Re: Best place to use AND how to validate a Version
Date: Thu, 27 Oct 2005 03:52:04 -0700
Lines: 128
Message-ID: <BD************ *************** *******@microso ft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 8bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.webservices :8381
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.webservices

Just a followup:

I like the idea of using versions in the namespace. However, Steven, in
your example, the datatypes schema was seperate from the message schema.
If
you are on say:

"http://mywebservice/datatypes/2005/10/27", and
"http://mywebservice/contract/2005/10/27"

then change to

"http://mywebservice/datatypes/2005/12/5". If this happens I should also
have to change my contract/message schema, correct?

Is there a place that documents "Best Practices" for this? I was initially
defining datatypes and messages in the same schema. I would assume that is
alright for a small system?

Thanks for the help.
--
Mike Logan
"Marvin Smit" wrote:
Hi Guys,

This is such a nice topic i couldn't resist putting my 2ct. in ;-)

The versioning scheme suggested by Henrik is a very common one. You
essentially have the following options;

- Modify your namespace-uri for different versions (*the example
below)
This is a very strict way of versioning. The problem is that for each
new version your clients will have to "update reference & recompile".

- include version attribute in your schema
This is how it was intended, but i no of NONE XML-XSD parser that will
actually read/use the version attribute and be able to have multiple
versions of the same schema.

Please be aware that when you are developing a WebService with .Net
(same goes for Axis AFAIK) that;

- XSD Validation on the incomming message is NOT THERE by default.
- The deserialization happens with "Defaults" (i.e. an element that is
not found will be filled with ; 0 for numbers, "" for strings, etc)
- The .Net types representing the XSD complextypes are not 100% XSD
equivilant. (You loose the facets in the .Net type, like
'maxInclusive', maxLength, etc)

Hope this helps,

Marvin Smit.
On Thu, 27 Oct 2005 08:03:46 +0200, Henrik Gøttig <hg@websolver.d k>
wrote:
Hi Steven and Mike

Sorry for inteferring your thread but..

I don't know if it is considered "bad practice", but one could also
embed versioninfo in the XML namespace as:

http://myservice/datatypes/customer/10
for version 1.0 of the customer datatype

and http://myservice/datatypes/customer/11
for the version 1.1 of the customer datatype

Similar approach could be taken with the contracts.

Anyway. Are there any drawbacks with this approach?
One thing maybe.. A 1.0 client proxy will no be able to "talk" to a 1.1
Webservice, will it?

Isn't it right that Indigo deal with this, as there can be many
"contracts" assigned to a single service?

Looking forward to hear your insights.

Regards

Henrik

Steven Cheng[MSFT] wrote:
Hi Mike,

For the Xml Types we defined in Xml schemas for webservice's data type or WSDL's message element type, they're all identified and scoped by xml
namespace. So generally, for the xml data types and message element types, we will scope them under the sample namespace(or same root namespace....) for example:

we can define the root namespace of our webservice as:

http://myservice/

and the xml schema can use a sub namespace like:

http://myservice/datatypes

wsdl message types can use

http://myservice/contract

as namespace. There is no version info for xml types, just use XML
namespace to identify their scope. Also, at runtime, the webservice engine , e.g the ASP.NET webservice handler will parse the xml content and mapping the xml data to types through namespace. So when you need to define new version of the datatypes, you can just define a new schema or other xml data with new namespace....

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Nov 23 '05 #9
Hi Mike,

Any further questions on this issue? If there're anything else we can help,
pleas feel free to post here.
Thanks ,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
X-Tomcat-ID: 38917779
References: <00************ *************** *******@microso ft.com>
<HY************ **@TK2MSFTNGXA0 1.phx.gbl>
<u9************ **@TK2MSFTNGP09 .phx.gbl>
<54************ *************** *****@4ax.com>
<BD************ *************** *******@microso ft.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_0001 _4E822A8D"
Content-Transfer-Encoding: 7bit
From: st*****@online. microsoft.com (Steven Cheng[MSFT])
Organization: Microsoft
Date: Fri, 28 Oct 2005 02:15:50 GMT
Subject: Re: Best place to use AND how to validate a Version
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.webservices
Message-ID: <z5************ **@TK2MSFTNGXA0 1.phx.gbl>
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
Lines: 325
Path: TK2MSFTNGXA01.p hx.gbl
Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.webservices :8396
NNTP-Posting-Host: tomcatimport2.p hx.gbl 10.201.218.182

Hi Mike,

Of course, we can defining datatypes and messages in the same schema.
Actually there is no definite rules on this. If you need to adopt some best
practice, you may try searching some existing webservice contracts/types
schema on the net and get some ideas from them.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
Thread-Topic: Best place to use AND how to validate a Version
thread-index: AcXa5HfN7e4LdWi CSDyZuPNob21Ngg ==
X-WBNR-Posting-Host: 165.176.240.10
From: "=?Utf-8?B?TWlrZSBMb2d hbg==?=" <Mi*******@comm unity.nospam>
References: <00************ *************** *******@microso ft.com>
<HY************ **@TK2MSFTNGXA0 1.phx.gbl>
<u9************ **@TK2MSFTNGP09 .phx.gbl>
<54************ *************** *****@4ax.com>
Subject: Re: Best place to use AND how to validate a Version
Date: Thu, 27 Oct 2005 03:52:04 -0700
Lines: 128
Message-ID: <BD************ *************** *******@microso ft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 8bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.webservices :8381
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.webservices

Just a followup:

I like the idea of using versions in the namespace. However, Steven, in
your example, the datatypes schema was seperate from the message schema.
If
you are on say:

"http://mywebservice/datatypes/2005/10/27", and
"http://mywebservice/contract/2005/10/27"

then change to

"http://mywebservice/datatypes/2005/12/5". If this happens I should also
have to change my contract/message schema, correct?

Is there a place that documents "Best Practices" for this? I was initially
defining datatypes and messages in the same schema. I would assume that is
alright for a small system?

Thanks for the help.
--
Mike Logan
"Marvin Smit" wrote:
Hi Guys,

This is such a nice topic i couldn't resist putting my 2ct. in ;-)

The versioning scheme suggested by Henrik is a very common one. You
essentially have the following options;

- Modify your namespace-uri for different versions (*the example
below)
This is a very strict way of versioning. The problem is that for each
new version your clients will have to "update reference & recompile".

- include version attribute in your schema
This is how it was intended, but i no of NONE XML-XSD parser that will
actually read/use the version attribute and be able to have multiple
versions of the same schema.

Please be aware that when you are developing a WebService with .Net
(same goes for Axis AFAIK) that;

- XSD Validation on the incomming message is NOT THERE by default.
- The deserialization happens with "Defaults" (i.e. an element that is
not found will be filled with ; 0 for numbers, "" for strings, etc)
- The .Net types representing the XSD complextypes are not 100% XSD
equivilant. (You loose the facets in the .Net type, like
'maxInclusive', maxLength, etc)

Hope this helps,

Marvin Smit.
On Thu, 27 Oct 2005 08:03:46 +0200, Henrik Gøttig <hg@websolver.d k>
wrote:
Hi Steven and Mike

Sorry for inteferring your thread but..

I don't know if it is considered "bad practice", but one could also
embed versioninfo in the XML namespace as:

http://myservice/datatypes/customer/10
for version 1.0 of the customer datatype

and http://myservice/datatypes/customer/11
for the version 1.1 of the customer datatype

Similar approach could be taken with the contracts.

Anyway. Are there any drawbacks with this approach?
One thing maybe.. A 1.0 client proxy will no be able to "talk" to a 1.1
Webservice, will it?

Isn't it right that Indigo deal with this, as there can be many
"contracts" assigned to a single service?

Looking forward to hear your insights.

Regards

Henrik

Steven Cheng[MSFT] wrote:
Hi Mike,

For the Xml Types we defined in Xml schemas for webservice's data type or WSDL's message element type, they're all identified and scoped by xml
namespace. So generally, for the xml data types and message element types, we will scope them under the sample namespace(or same root namespace....) for example:

we can define the root namespace of our webservice as:

http://myservice/

and the xml schema can use a sub namespace like:

http://myservice/datatypes

wsdl message types can use

http://myservice/contract

as namespace. There is no version info for xml types, just use XML
namespace to identify their scope. Also, at runtime, the webservice engine , e.g the ASP.NET webservice handler will parse the xml content and mapping the xml data to types through namespace. So when you need to define new version of the datatypes, you can just define a new schema or other xml data with new namespace....

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Nov 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

131
21679
by: Peter Foti | last post by:
Simple question... which is better to use for defining font sizes and why? px and em seem to be the leading candidates. I know what the general answer is going to be, but I'm hoping to ultimately get some good real world examples. Fire away! :) Regards, Peter Foti
0
1251
by: Dave | last post by:
Hi all, I'm looking at designing an XSD for a signed document (enveloping) to be received from a third party. Primarily, I'm interested in what is the "best practice" with regards the following: 1) Should the XSD "import" the standard xmldsig schemas and add the signature element to the XSD or is this implied and not normally represented
10
3481
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read somewhere that each folder under the "web site" is compiled in separate assembly. I however, did not find that the "web site" creation in vs.net 2005 created any AssemblyInfo.cs file.
8
1572
by: SStory | last post by:
When I right a class, I am wondering what are the best practices for error handling? Do I try..catch and trap the error and if so what do I do with it? Because most likely the class user will want to know the information in the exception.... That being the case do I just not catch it and let the user of the class catch it and get all the information? I know I could catch it and throw my own, but I'd have to tell them the same
9
4179
by: julie.siebel | last post by:
Hello all! As embarrassing as it is to admit this, I've been designing db driven websites using javascript and vbscript for about 6-7 years now, and I am *horrible* at form validation. To be honest I usually hire someone to do it for me, grab predone scripts and kind of hack out the parts that I need, or just do very minimal validation (e.g. this is numeric, this is alpha-numeric, etc.)
7
6997
by: h7qvnk7q001 | last post by:
I'm trying to implement a simple server-side form validation (No Javascript). If the user submits a form with errors, I want to redisplay the same form with the errors highlighted. Once the form is correct I need to submit to another page that uses the form data. I first tried making the form submit action= field point to the same file. When the form was correct, I tried loading the next page by using <META http-equiv refresh>. But...
17
5284
by: Petyr David | last post by:
Just looking for the simplest. right now my perl script returns an error messge to the user if the date string is invalid. would like to do this before accessing the server. TX
41
2883
by: Jim | last post by:
Hi guys, I have an object which represents an "item" in a CMS "component" where an "item" in the most basic form just a field, and a "component" is effectively a table. "item" objects can be created and then added to "component" objects to build up the component definition. My dilemma comes in deciding how to read/write data to the "item"
5
2885
by: Frank Millman | last post by:
Hi all This is not strictly a Python question, but as I am writing in Python, and as I know there are some XML gurus on this list, I hope it is appropriate here. XML-schemas are used to define the structure of an xml document, and to validate that a particular document conforms to the schema. They can also be used to transform the document, by filling in missing attributes with default values.
0
9297
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9735
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8736
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7285
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6556
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3828
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2697
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.