Ask a Question related to ASP.NET Web Services, Design and Development.
-
John Jenkins #1
WSDL Data type restrictions
Hi,
my queston relates to classes generated using XSD.exe from schemas.
Basically I have a number of schemas which contain data type definitions,
such as for example T_URN, which is a string and should be of length 9
chars. This is straightforward to do in the schema but when the class gets
generated none of the data type restrictions are transferred to the class
i.e. my T_URN is simply of type string. This (obviously) will cause issues
when I expose the WSDL of my webservice, since a user of the service could
add a string of length 12, 15 or whatever. When this is submitted to my
service and I validated the object against the relevant schema an error will
be thrown.
I may have asked this question before, but...is there any tool that will
automatically instill the schema restrictions into my classes at generation
time?? or do I have to do this manually after generating the class?
Thanks in advance.
John Jenkins Guest
-
using Web Service with Complex-Type in WSDL
I have a web service developed in BEA WebLogic that I am trying to call. The WSDL has two complex types in it and is of type document/literal. When... -
Converting from data type varchar to data type money
Hi all, Tearing my hair out trying to figure this out. If anyone can provide any help i would greatly appreciate it. When I try to do an insert... -
Converting data type varchar to data type money
Hi all, Tearing my hair out trying to figure this out. If anyone can provide any help i would greatly appreciate it. When I try to do an insert... -
Passing Array type to WSDL
Hi, I am writing a CFC which takes the array as input and return type as string. Wondering how i can display the field properties of the... -
Mapping of type string in WSDL
Hi I've got the following webmethod: public string Hello( string name) { return "Hello " + name; } -
Dan Rogers #2
RE: WSDL Data type restrictions
Hi John,
The XSD.exe tool does not do what you wish. A primary issue when designing
a web service that is using objects to execute is to decide on the type
system you are favoring. The authors of XSD invented a new type system
that includes descriptive limitations - and given the SGML roots of XML,
this seemed reasonable. However, when implementing XML interface
descriptions of object based types and methods, you need to consider
whether the description you are using fits with the implementation. With
the exception of some third party products, I've not seen any tools that
automatically add in a validation layer that repeats the checks defined in
restrictions in schema.
For requests being made via the classes, you could add in validation such
as length checks, etc in the property setters for your classes. XSD.exe,
however, implements field based classes - so there is no setter logic to
add code to.
You may want to check for commercial products that provide application
framework level validation and code generation based on schema. You may
also want to try out tools like XsdObjectGen.exe which create code much
like XSD.exe does - except provide the getter/setter logic, as well as a
method framework for creating schema valid output, as well as for hooking
validation logic to the generated classes without having to change the
generated code.
I hope this helps,
Dan Rogers
Microsoft Corporation
--------------------20:13:39 GMT)>From: "John Jenkins" <john_Jenkins@yahoo.com>
>Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
>Subject: WSDL Data type restrictions
>Lines: 20
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
>Message-ID: <TFWJc.284$qS6.235@newsfe1-win.ntli.net>
>Date: Fri, 16 Jul 2004 20:13:39 GMT
>NNTP-Posting-Host: 213.107.99.126
>X-Complaints-To: [url]http://www.ntlworld.com/netreport[/url]
>X-Trace: newsfe1-win.ntli.net 1090008819 213.107.99.126 (Fri, 16 Jul 2004cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin>NNTP-Posting-Date: Fri, 16 Jul 2004 20:13:39 GMT
>Organization: ntl Cablemodem News Service
>Path:
e.de!tiscali!newsfeed1.ip.tiscali.net!216.196.110. 149.MISMATCH!border2.nntp.
ams.giganews.com!nntp.giganews.com!news-out.ntli.net!newsrout1.ntli.net!news
-in.ntli.net!ntli.net!newspeer1-win.ntli.net!newsfe1-win.ntli.net.POSTED!53a
b2750!not-for-mailmicrosoft.public.dotnet.framework.aspnet.webservic es:24633>Xref: cpmsftngxa06.phx.gblwill>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
>
>Hi,
> my queston relates to classes generated using XSD.exe from schemas.
>Basically I have a number of schemas which contain data type definitions,
>such as for example T_URN, which is a string and should be of length 9
>chars. This is straightforward to do in the schema but when the class gets
>generated none of the data type restrictions are transferred to the class
>i.e. my T_URN is simply of type string. This (obviously) will cause issues
>when I expose the WSDL of my webservice, since a user of the service could
>add a string of length 12, 15 or whatever. When this is submitted to my
>service and I validated the object against the relevant schema an error>be thrown.
>
>I may have asked this question before, but...is there any tool that will
>automatically instill the schema restrictions into my classes at generation
>time?? or do I have to do this manually after generating the class?
>
>Thanks in advance.
>
>
>
>Dan Rogers Guest



Reply With Quote

