Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 26th, 2005, 01:04 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Right, that makes sense.

Thanks for the update.

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Singing The Blues by Tricky (Track 3 from the album: Angels With Dirty Faces) What's This?
 
Old March 10th, 2006, 04:07 PM
Registered User
 
Join Date: Mar 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, I have a similar problem where rodmcleay's solution is no good.

For simplicity, say I have a very simple classlib (Common) that is used on both the client side and the server side of a web service.

namespace Common
{
  class Person
  {
    public string firstName, lastName;

    // FullName represents functionality used on both sides
    public string FullName {
      get { return firstName + " " + lastName; }
    }
  }
}

This class is used as parameters for a web service.
How do I get both sides to use the same type without having to cast?

I have done some research and only found "crappy" solutions to the problem.

The WebServiceBinding attribute looks promising, but I have not found any way to keep the classes I use in my web service from being replicated in the auto generated References.cs.

It's very easy to edit the References.cs-file manually to make it fit my classes. However, I am lazy and would like to not have to edit the References file every time I change the web service interface.

Any bright Ideas?

(

Best regards,
Torbjorn
 
Old November 2nd, 2006, 07:24 PM
Registered User
 
Join Date: Nov 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have same problem and tried referring to the class from webservice but the constructor(with parameters) is not accesible. As of now, i serialize and deserialize ... not happy though. Can some one help me with a easier solution?

 
Old November 2nd, 2006, 07:30 PM
Registered User
 
Join Date: Nov 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Iam in same boat. I tried serializing and deserializing and it works. But if I refer to the class in webservice directly instead of local reference, I am not able to access the constructors of the classes. Any suggestions?






Similar Threads
Thread Thread Starter Forum Replies Last Post
Web Service, Custom Control, Custom Return Type robzyc ASP.NET 2.0 Basics 6 June 10th, 2008 08:03 AM
Send custom E-mail using sharepoint services ddaz0102 SharePoint Development 0 May 10th, 2007 01:42 PM
Custom Classes and Functions harpua Flash (all versions) 0 February 3rd, 2006 02:43 AM
Web Services Error (Ch18) - No Web Disc. Info. ElPato BOOK: Beginning ASP.NET 1.0 2 April 13th, 2005 03:27 PM
Custom Classes!! NitinJoshi General .NET 1 January 25th, 2005 01:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.