How to pass an object as parameter ?

Discussion in 'ASP .Net Web Services' started by chak, Dec 13, 2004.

  1. chak

    chak Guest

    I have a class with public properties defined in an assembly. I then have a
    web service in
    the same solution, which takes an object of this class as a parameter.
    However, the web service works only if i key in the the fully qualified
    name of the object (including namespace) in the proxy class. How can this
    be avoided ?




    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.809 / Virus Database: 551 - Release Date: 12/9/2004
    chak, Dec 13, 2004
    #1
    1. Advertising

  2. Have you tried adding a using or Imports statement to the top of the
    proxy class' file? It is these statements that give developers the
    luxury of not having to type the full namespace.

    Bruce Johnson [.NET MVP]
    http://www.objectsharp.com/blogs/bruce

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Bruce Johnson, Dec 13, 2004
    #2
    1. Advertising

  3. chak

    Dan Rogers Guest

    Hi,

    If it is your intent to have the same implementation shared by the client
    and the server, then you will need to modify the proxy class that is
    generated to use the namespace you desire - and you will also have to add
    that DLL as a reference to the client-side project.

    The generated proxy has a "data compabible" implementation of the classes
    that the service requests as inputs and return types. You'll probably want
    to comment these out if you change the generated proxy.

    Alternately, you could make the generated proxy have the same namespace as
    your server side data DLL. This way, you won't have to change any of the
    generated code.

    I hope this helps

    Dan Rogers
    Microsoft Corporation
    --------------------
    >From: "chak" <>
    >Subject: How to pass an object as parameter ?
    >Date: Mon, 13 Dec 2004 07:54:27 +0530
    >Lines: 16
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    >X-RFC2646: Format=Flowed; Original
    >Message-ID: <>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    >NNTP-Posting-Host: 220.226.4.22
    >Path:

    cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14
    phx.gbl
    >Xref: cpmsftngxa10.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webservices:27153
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >
    >I have a class with public properties defined in an assembly. I then have

    a
    >web service in
    >the same solution, which takes an object of this class as a parameter.
    >However, the web service works only if i key in the the fully qualified
    >name of the object (including namespace) in the proxy class. How can this
    >be avoided ?
    >
    >
    >
    >
    >---
    >Outgoing mail is certified Virus Free.
    >Checked by AVG anti-virus system (http://www.grisoft.com).
    >Version: 6.0.809 / Virus Database: 551 - Release Date: 12/9/2004
    >
    >
    >
    Dan Rogers, Dec 13, 2004
    #3
  4. chak

    chak Guest

    Thanks. I have changed the proxy namespace to be the same as that of the
    custom class and so far things seem to work.


    "Dan Rogers" <> wrote in message
    news:7$O%...
    > Hi,
    >
    > If it is your intent to have the same implementation shared by the client
    > and the server, then you will need to modify the proxy class that is
    > generated to use the namespace you desire - and you will also have to add
    > that DLL as a reference to the client-side project.
    >
    > The generated proxy has a "data compabible" implementation of the classes
    > that the service requests as inputs and return types. You'll probably
    > want
    > to comment these out if you change the generated proxy.
    >
    > Alternately, you could make the generated proxy have the same namespace as
    > your server side data DLL. This way, you won't have to change any of the
    > generated code.
    >
    > I hope this helps
    >
    > Dan Rogers
    > Microsoft Corporation
    > --------------------
    >>From: "chak" <>
    >>Subject: How to pass an object as parameter ?
    >>Date: Mon, 13 Dec 2004 07:54:27 +0530
    >>Lines: 16
    >>X-Priority: 3
    >>X-MSMail-Priority: Normal
    >>X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    >>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    >>X-RFC2646: Format=Flowed; Original
    >>Message-ID: <>
    >>Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    >>NNTP-Posting-Host: 220.226.4.22
    >>Path:

    > cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14
    > phx.gbl
    >>Xref: cpmsftngxa10.phx.gbl

    > microsoft.public.dotnet.framework.aspnet.webservices:27153
    >>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >>
    >>I have a class with public properties defined in an assembly. I then have

    > a
    >>web service in
    >>the same solution, which takes an object of this class as a parameter.
    >>However, the web service works only if i key in the the fully qualified
    >>name of the object (including namespace) in the proxy class. How can this
    >>be avoided ?
    >>
    >>
    >>
    >>
    >>---
    >>Outgoing mail is certified Virus Free.
    >>Checked by AVG anti-virus system (http://www.grisoft.com).
    >>Version: 6.0.809 / Virus Database: 551 - Release Date: 12/9/2004
    >>
    >>
    >>

    >



    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.809 / Virus Database: 551 - Release Date: 12/9/2004
    chak, Dec 14, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    961
    Sharad Kala
    Dec 17, 2004
  2. James
    Replies:
    7
    Views:
    472
    Marcus Kwok
    Oct 13, 2005
  3. Hiker123
    Replies:
    1
    Views:
    2,484
    Arne Vajhøj
    Jan 4, 2009
  4. fuzzylogic
    Replies:
    0
    Views:
    261
    fuzzylogic
    Jun 23, 2006
  5. AzamSharp
    Replies:
    2
    Views:
    174
Loading...

Share This Page