SYMPTOMS
When you use the
HttpChannel class to remote an object in a Microsoft .NET Framework 2.0 Remoting application, the Web Services Description Language (WSDL) that is generated from the remote object may not include the type information for nested types or for types that include overloaded methods in the remote object. For example, you may use code that resembles the following code examples for the remote object.
Example 1
This example is about the nested types.
class MyRemoteClass : System.MarshalByRefObject
{
public MyRemoteClass()
{ }
public EmpDetail GetEmpInfo()
{
return new EmpDetail();
}
}
In this example, the
EmpDetail class is contained in another assembly that is defined by using the following code example.
[Serializable]
public class EmpDetail
{
private string m_Id;
private string m_description;
public string Id
{
get
{ return m_Id; }
set
{ m_Id = value; }
}
public string Description
{
get
{ return m_description; }
set
{ m_description = value; }
}
}
In this example, when you examine the WSDL that is generated from the remote object, you notice that there is no type information for the
ID property or for the
Description property.
Example 2
This example is about the types that include overloaded methods.
The following code is in the client.
using System;
class app
{
static void Main()
{
DogService ds = new DogService();
Console.WriteLine(ds.Bark("steve", "citect"));
Console.WriteLine(ds.Bark());
}
}
The following code is in the server.
using System;
using System.Text;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;
using System.Threading;
public class Dog : MarshalByRefObject
{
public string Bark()
{
return "woof";
}
public string Bark(string userName, string password)
{
return userName + password;
}
}
class Program
{
static void Main(string[] args)
{
HttpChannel ch = new HttpChannel(7777);
ChannelServices.RegisterChannel(ch);
string uri = string.Concat("b1/", typeof(Dog).Name);
Console.WriteLine(uri);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(Dog), uri, WellKnownObjectMode.Singleton);
Console.WriteLine("open for business");
Console.ReadLine();
}
}
In this example, when you examine the WSDL that is generated from the remote object, you may receive an
NullReferenceException exception when you step over the overloaded method call.
RESOLUTION
A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft .NET Framework 2.0 service pack that contains this hotfix.
To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:
Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.
Prerequisites
To apply this hotfix, you must be running the .NET Framework 2.0.
Restart requirement
You must restart the computer after you apply this hotfix.
Hotfix replacement information
This hotfix does not replace any other hotfixes.
File information
The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the
Time Zone tab in the Date and Time item in Control Panel.
|
Mscordacwks.dll | 2.0.50727.97 | 800,256 | 07-Apr-2006 | 03:58 | x86 |
Mscorlib.dll | 2.0.50727.97 | 4,317,184 | 07-Apr-2006 | 03:58 | x86 |
Mscorwks.dll | 2.0.50727.97 | 5,618,176 | 07-Apr-2006 | 03:58 | x86 |
Normalization.dll | 2.0.50727.97 | 15,360 | 07-Apr-2006 | 03:58 | x86 |
Sos.dll | 2.0.50727.97 | 377,344 | 07-Apr-2006 | 03:58 | x86 |
System.data.dll | 2.0.50727.97 | 2,893,312 | 07-Apr-2006 | 03:58 | x86 |
System.data.oracleclient.dll | 2.0.50727.97 | 482,304 | 07-Apr-2006 | 03:58 | x86 |
System.dll | 2.0.50727.97 | 3,018,752 | 07-Apr-2006 | 03:58 | x86 |
System.runtime.remoting.dll | 2.0.50727.97 | 294,912 | 07-Apr-2006 | 03:58 | x86 |