Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > How to pass an object as parameter ?

Reply
Thread Tools

How to pass an object as parameter ?

 
 
chak
Guest
Posts: n/a
 
      12-13-2004
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


 
Reply With Quote
 
 
 
 
Bruce Johnson
Guest
Posts: n/a
 
      12-13-2004
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!
 
Reply With Quote
 
 
 
 
Dan Rogers
Guest
Posts: n/a
 
      12-13-2004
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" <(E-Mail Removed)>
>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: <(E-Mail Removed)>
>Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
>NNTP-Posting-Host: 220.226.4.22
>Path:

cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP14
phx.gbl
>Xref: cpmsftngxa10.phx.gbl

microsoft.public.dotnet.framework.aspnet.webservic es:27153
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
>
>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
>
>
>


 
Reply With Quote
 
chak
Guest
Posts: n/a
 
      12-14-2004
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" <(E-Mail Removed)> wrote in message
news:7$O%(E-Mail Removed)...
> 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" <(E-Mail Removed)>
>>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: <(E-Mail Removed)>
>>Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
>>NNTP-Posting-Host: 220.226.4.22
>>Path:

> cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP14
> phx.gbl
>>Xref: cpmsftngxa10.phx.gbl

> microsoft.public.dotnet.framework.aspnet.webservic es:27153
>>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
>>
>>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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to pass an Object as parameter in Java Applet Hiker123 Java 1 01-04-2009 11:05 PM
How to pass a parameter for a function parameter in a function AzamSharp Javascript 2 07-05-2008 12:24 AM
Beginner question: Pass object as class parameter James C++ 7 10-13-2005 07:39 PM
How to pass a bitmap parameter to a COM object? aruizdeinfante@yahoo.es C++ 1 12-17-2004 01:48 PM



Advertisments