Custom Class in a Web Service

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Josue Avila M.

    #1

    Custom Class in a Web Service

    HI
    I Design a Class Wich contains severals DataTypes . (2 Strings and Other
    Data Types from a Class wich i Desing to)
    Its Something like This

    <serializable() >
    Public Class Emitor
    Public NameMsg as String
    Public KeyCode as String
    Public Parmas as DAtaParams


    Public Class DataParams
    inherits Arraylist



    Ok thats de Way ... When i Use The Class into the web service it create the
    ..asmx succesfuly but in the soap envelope seccion
    it does'nt represent the Xml Code Element to the datatype of Param argument
    ... So on the client Cosumer does reconize it

    I Read in a document that i need to use the SoapRPCMethod Attribute and the
    SoapInlcude (gettype(class) ) in the function that use to pass this data
    However when i compile the WS ... i get an error abot the
    system.data.dat aset it imposible to searilize on a sope code ... (Ha!!!! I
    missed... it the web service im using a Dataset and in tje DataParams Class
    To )

    So please Any Body Help..
    Where Do i Put the Descripto for the class or do i Have to use XMLAttributes
    on my class definition ...
    Thaks A lot











  • Dan Rogers

    #2
    RE: Custom Class in a Web Service

    Hi Josue,

    Custom classes such as this are definitely supported in both return and
    parameter arguments for web methods. The default behaviors
    (SoapDocumentSe rviceAttribute) handles this well.

    When you say it is not seen in the client, what do you mean. If you have
    your custom classes as inputs or outputs to your methods, the WSDL should
    reflect the right types, and the generated proxy will contain a projection
    of your classes.

    I hope this helps

    Dan Rogers
    Microsoft Corporation
    --------------------
    From: "Josue Avila M." <josue_avila200 @hotmail.com>
    Subject: Custom Class in a Web Service
    Date: Thu, 25 Nov 2004 22:21:43 -0600
    Lines: 44
    X-Priority: 3
    X-MSMail-Priority: Normal
    X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
    X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
    Message-ID: <udLdv920EHA.16 52@TK2MSFTNGP11 .phx.gbl>
    Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
    NNTP-Posting-Host: dsl-201-129-76-67.prod-infinitum.com.m x 201.129.76.67
    Path:
    cpmsftngxa10.ph x.gbl!TK2MSFTFE ED01.phx.gbl!TK 2MSFTNGP08.phx. gbl!TK2MSFTNGP1 1
    .phx.gbl
    Xref: cpmsftngxa10.ph x.gbl
    microsoft.publi c.dotnet.framew ork.webservices :7642
    X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.webservices

    HI
    I Design a Class Wich contains severals DataTypes . (2 Strings and Other
    Data Types from a Class wich i Desing to)
    Its Something like This

    <serializable() >
    Public Class Emitor
    Public NameMsg as String
    Public KeyCode as String
    Public Parmas as DAtaParams


    Public Class DataParams
    inherits Arraylist



    Ok thats de Way ... When i Use The Class into the web service it create the
    .asmx succesfuly but in the soap envelope seccion
    it does'nt represent the Xml Code Element to the datatype of Param argument
    .. So on the client Cosumer does reconize it

    I Read in a document that i need to use the SoapRPCMethod Attribute and the
    SoapInlcude (gettype(class) ) in the function that use to pass this data
    However when i compile the WS ... i get an error abot the
    system.data.dat aset it imposible to searilize on a sope code ... (Ha!!!! I
    missed... it the web service im using a Dataset and in tje DataParams Class
    To )

    So please Any Body Help..
    Where Do i Put the Descripto for the class or do i Have to use XMLAttributes
    on my class definition ...
    Thaks A lot












    Comment

    Working...