Custom Datatypes and how to get rid of ArrayOfAnyType.

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

  1. #1

    Default Custom Datatypes and how to get rid of ArrayOfAnyType.

    I am writing a Web Service, using ASP.NET. I have two different collections
    in a separate DLL, which I want to return from two different WebMethods in
    the same Web Service. However, when serialized, both collections appear in
    the XML message something like this :

    <?xml version="1.0" encoding="utf-8" ?>
    <ArrayOfAnyType xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
    xmlns="http://eric.the.name.space.com">
    <anyType xsi:type="TheRealType">
    <OwnerId>Id</OwnerId>
    <Key>Key</Key>
    </anyType>
    <anyType xsi:type="TheRealType">
    <OwnerId>Id</OwnerId>
    <Key>Key</Key>
    </anyType>
    </ArrayOfAnyType>

    Now, how can I force the WebMethod to make the elements within the array not
    be <anyType xsi:type="TheRealType">...</>, but be <TheRealType> ... </>, and
    the array not to be ArrayOfAnyType, but to be ArrayOfTheRealType?

    Currently, because the two methods return ArrayOfAnyType, it causes a
    confusion in .NET, when it creates the temporary C# DLL, and I get an
    InvalidCastException (see previous posting).

    Thanks.


    Eric Porter Guest

  2. Similar Questions and Discussions

    1. Converting Datatypes
      Hi, I need to change a varchar field in my DB to a small date/time field. The problem is I don't want to lose the data, as I have quite a lot of...
    2. Complex DataTypes
      Ok, I created a Web Service using PHP5 SOAP extension. I created the WSDL and I can serve and consume that service in PHP. Now I am trying to...
    3. sql=access=datatypes?
      What would be the corresponding data types for the following existing Access data types: Autonumber = (UniqueIdentifier?) Number =...
    4. Persisting Component Datatypes in Custom Controls
      *** Appologies if a very similar version of this appears in the group *** I noticed my question has been answered before but I'm not very clear...
    5. Datatypes in Informix
      Hi, I am trying to obtain an extract of my Informix database into a formatted spreadsheet. The information of the fields in a table is...
  3. #2

    Default Re: Custom Datatypes and how to get rid of ArrayOfAnyType.

    I should add that the <ArrayOfAnyType> nonesense is associated with the HTTP
    POST test. If the documentation of the test Web page is to be believed,
    using
    [return : XmlElement(typeof(TheRealType))]
    on the web method definition gives the correct sort of soap message.

    But it would be nice if this were worked in the HTTP POST test.

    Thanks.
    "Eric Porter" <bodyremp70@hotmail.com> wrote in message
    news:cc3nc5$jcn$1$830fa17d@news.demon.co.uk...
    > I am writing a Web Service, using ASP.NET. I have two different
    collections
    > in a separate DLL, which I want to return from two different WebMethods in
    > the same Web Service. However, when serialized, both collections appear
    in
    > the XML message something like this :
    >
    > <?xml version="1.0" encoding="utf-8" ?>
    > <ArrayOfAnyType xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    > xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
    > xmlns="http://eric.the.name.space.com">
    > <anyType xsi:type="TheRealType">
    > <OwnerId>Id</OwnerId>
    > <Key>Key</Key>
    > </anyType>
    > <anyType xsi:type="TheRealType">
    > <OwnerId>Id</OwnerId>
    > <Key>Key</Key>
    > </anyType>
    > </ArrayOfAnyType>
    >
    > Now, how can I force the WebMethod to make the elements within the array
    not
    > be <anyType xsi:type="TheRealType">...</>, but be <TheRealType> ... </>,
    and
    > the array not to be ArrayOfAnyType, but to be ArrayOfTheRealType?
    >
    > Currently, because the two methods return ArrayOfAnyType, it causes a
    > confusion in .NET, when it creates the temporary C# DLL, and I get an
    > InvalidCastException (see previous posting).
    >
    > Thanks.
    >
    >

    Eric Porter 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