WSDL Data type restrictions

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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...
    5. Mapping of type string in WSDL
      Hi I've got the following webmethod: public string Hello( string name) { return "Hello " + name; }
  3. #2

    Default 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
    --------------------
    >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 2004
    20:13:39 GMT)
    >NNTP-Posting-Date: Fri, 16 Jul 2004 20:13:39 GMT
    >Organization: ntl Cablemodem News Service
    >Path:
    cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin
    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-mail
    >Xref: cpmsftngxa06.phx.gbl
    microsoft.public.dotnet.framework.aspnet.webservic es:24633
    >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
    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.
    >
    >
    >
    >
    Dan Rogers Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139