Re: Web Services Arrays

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Paul Janssen (paul.janssen_at_camtronics.com.REMOVE_THIS_PART)
Date: 09/09/04

  • Next message: suresh g: "Re: WebException while calling Web Service over HTTPS..."
    Date: Thu, 9 Sep 2004 11:33:02 -0700
    
    

    How can I do the same thing with typed datasets? XmlInclude doesn't work
    because the datasets already implement ISerializable. I want to use typed
    datasets in my web service as well as my web service clients. Because of
    performance reasons the instances of the typed datasets are passed as
    compressed xml strings and re-hydrated on the server and client. How can I
    include the definition of my typed dataset in the wsdl if the typed dataset
    class is not actually used as a parameter in the web method?

    "Dale" wrote:

    > Look up the XMLInclude attribute. That will define your class to the owning
    > class or method's serialization process. You apply one XMLInclude attribute
    > to the owning class or WebMethod for each class used within the owning class
    > or WebMethod:.
    >
    > [WebMethod()]
    > [XmlInclude(typeof(Car)), XmlInclude(typeof(Bike))]
    > public Vehicle Vehicle(string licenseNumber)
    > {
    > //method implementation here
    > }
    >
    > Dale
    >
    > "John Jenkins" <john_Jenkins@yahoo.com> wrote in message
    > news:t2BLc.1473$mO6.568@newsfe2-gui.ntli.net...
    > > Hi,
    > > does anyone know if there are any issues with .Net when it creates
    > > proxies for classes that contain an array of another class, for example..
    > >
    > > // some serialization attributes XMLRootElement etc
    > > public class x(){
    > >
    > > public T_SOMECLASS[];
    > > }
    > >
    > > // some serialization attributes
    > > public class T_SOMECLASS(){
    > >
    > > public string xxx;
    > >
    > > }
    > >
    > > I have defined a web method like
    > >
    > > [webmethod]
    > > public x myMethod(){}
    > >
    > > my problem is that when i generate my proxies the client side class knows
    > > nothing about class x only class T_SOMECLASS..my proxy looks something
    > like
    > >
    > > public T_SOMECLASS[] myMethod(){}
    > >
    > > It seems to ignore the class containing the class array as a root node.
    > > Does anyone have any idea what the issue is. If you require exact code I
    > can
    > > provide it.
    > >
    > > thanks in advance.
    > >
    > >
    >
    >
    >


  • Next message: suresh g: "Re: WebException while calling Web Service over HTTPS..."

    Relevant Pages

    • Typed DataSets and web services
      ... I am consuming a web service that returns arrays of classes which can ... Observe that this web service does not return a DataSet ... If it could be configured to use typed DataSets ...
      (microsoft.public.dotnet.languages.csharp)
    • Typed DataSets and web services
      ... I am consuming a web service that returns arrays of classes which can ... Observe that this web service does not return a DataSet ... If it could be configured to use typed DataSets ...
      (microsoft.public.dotnet.framework.webservices)
    • Re: Typed DataSets and web services
      ... Observe that this web service does not return a DataSet ... If it could be configured to use typed DataSets ... tailored classes, xml and DataSets. ... > Array DataSet.ToCustomClass(Type customType) ...
      (microsoft.public.dotnet.framework.webservices)
    • Re: Is that possible with web services?
      ... Look in the .Net Framework documentation and online for XmlInclude Attribute ... a XmlSerializer to create an XML stream of your object and pass the text. ... Create all the objects in the web service. ... In your client application, ...
      (microsoft.public.dotnet.framework.webservices)
    • Re: DataSets and default columns
      ... however the typed datasets are defined in the web ... client for a client specific dataset, but not in the web service. ... "AllowNull" property. ... You can add some custom method for the TableAdapter (which change the ...
      (microsoft.public.dotnet.framework.webservices)