By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,137 Members | 2,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,137 IT Pros & Developers. It's quick & easy.

System.InvalidCastException: Cannot assign object of type

P: n/a
I have a Web Application written in C#. I am trying to call a web service
method and recieve the error:
System.InvalidCastException: Cannot assign object of type System.Boolean to
an object of type System.String.

I am able to call other methods within the same web service but not this
one. Here is the generated code for this method after adding the Web
Reference:

[System.Web.Services.Protocols.SoapRpcMethodAttribu te("urn:CometTrackerServer100Intf-ICometTrackerServer109#GetGPSData",
RequestNamespace="urn:CometTrackerServer100Intf-ICometTrackerServer109",
ResponseNamespace="urn:CometTrackerServer100Intf-ICometTrackerServer109")]
[return: System.Xml.Serialization.SoapElementAttribute("GPS Data")]
public string GetGPSData(string SessionID, long RecID, out bool
@return)
{
object[] results = this.Invoke("GetGPSData", new object[] {
SessionID,
RecID});
@return = ((bool)(results[1]));
return ((string)(results[0]));
}
Looks to me like the problem occurs when the response is being sent back.
Exception specifically points to the line containing the "Invoke" method. I
never get past the Invoke call. Also, the web service I am attaching to was
written in Delphi.

Looks like a compat issue, does anyone have any clues on this?

Thanks in adv, Jim

Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.