473,769 Members | 7,272 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
10 1990
A major issue I've been facing - It is often written that in document
literal style - one has a lot of flexibility and one can do two things
specifically -

1. Validate the SOAP body against a schema
2. Use an XSLT stylesheet to modify the SOAP body.

It seems from a previous post - schema validation is not automatically
done. How does one do it?

At what point can the stylesheet be applied - since the XML gets
converted to objects before I can do anything with it..

Thanks!

Steven Cheng[MSFT] wrote:
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 28 '05 #11

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

Similar topics

131
21690
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
1253
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
3482
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
4180
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
6998
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
2885
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
2886
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
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9997
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
9865
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...
1
7413
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
6675
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
5309
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...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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.