473,466 Members | 1,395 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Serialization issues using .NET Framework 2.0?

Hi,

I'm currently facing a problem with a mixed environment using .NET 1.1 and
..NET 2.0 web services.

We have a client application (the "client", system 1) running on .NET
2.0/WinXP, calling our web service (The "Web Service Server") running on a
separate machine (also .NET 2.0, Win2003 Server, system 2).

The web service server (system 2) itself makes calls to methods in the CRM
3.0 Server (the "CRM server", CRM 3.0 EAP, system 3), which is built on .NET
1.1. The CRM server also is a separate machine.

All systems are in the same domain and the user I'm testing with has
administrative rights and valid logons.

My current situation is the following:
Calling the CRM server (3) web services directly from either the client (1)
or the web service server (2) works without any problem.
Calling the Web service server (2) from the client (1) also works without
problems.
Making a call to the CRM server (3) from within a web service method of the
web service server (2) when called from the client (1) fails with the
following exception message:

System.Web.Services.Protocols.SoapException: Server was unable to process
request.
---> There was an error generating the XML document.
---> Unable to cast object of type
'muellerPrange.MediaCRM.Provider.CrmService30.WhoA mIRequest' to type
'muellerPrange.MediaCRM.Provider.CrmService30.Requ est'.
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)

The type listed in the exception is interchangable and will occur on every
type I pass or receive. I give you another example here:

System.Web.Services.Protocols.SoapException: Server was unable to process
request.
---> There was an error generating the XML document.
---> Unable to cast object of type
'muellerPrange.MediaCRM.Provider.CrmService30.Call erId' to type
'muellerPrange.MediaCRM.Provider.CrmService30.Call erId'.
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)

As you can see, the source and target types of the exception are identical.
It reads like "Cannot convert int to int", though this is a bad example
because int is a value type. However, I cannot work around this issue. I
thought that this may be related to impersination issues, but as far as I can
tell, credentials are passed correctly.

I'm still using the September CTP build of VS2005 and SQL Server 2005 (.NET
Framework version 2.0.50727), because I'm not able to access the MSDN
subscriber downloads since a week or so).

I saw some related posts in this newsgroups and wonder, if this is a bug in
the 2.0 Framework that may already have been fixed in the final version.

Any ideas?

Thanks,
Michael

Nov 23 '05 #1
3 5060
Hi,

one question popped in my mind;

Which programms (Client, WebService impl & CRM system) have a
reference to the ".Net" type of the dataclasses (Request/WhoAmIRequest
etc) assmbly?

The fun part is that the datatype used (on the wire) must be the same,
but in theimplementations.......

The datatypes used in the client => Generated from WSDL
The datatypes used in the WebService => Propagated types from the CRM
system (i assume).
The datatypes used in the CRM => native types?

Hope this helps,

Marvin Smit.
On Tue, 8 Nov 2005 02:09:02 -0800, "Michael Hoehne"
<mi************@nospam.nospam> wrote:
Hi,

I'm currently facing a problem with a mixed environment using .NET 1.1 and
.NET 2.0 web services.

We have a client application (the "client", system 1) running on .NET
2.0/WinXP, calling our web service (The "Web Service Server") running on a
separate machine (also .NET 2.0, Win2003 Server, system 2).

The web service server (system 2) itself makes calls to methods in the CRM
3.0 Server (the "CRM server", CRM 3.0 EAP, system 3), which is built on .NET
1.1. The CRM server also is a separate machine.

All systems are in the same domain and the user I'm testing with has
administrative rights and valid logons.

My current situation is the following:
Calling the CRM server (3) web services directly from either the client (1)
or the web service server (2) works without any problem.
Calling the Web service server (2) from the client (1) also works without
problems.
Making a call to the CRM server (3) from within a web service method of the
web service server (2) when called from the client (1) fails with the
following exception message:

System.Web.Services.Protocols.SoapException: Server was unable to process
request.
---> There was an error generating the XML document.
---> Unable to cast object of type
'muellerPrange.MediaCRM.Provider.CrmService30.Who AmIRequest' to type
'muellerPrange.MediaCRM.Provider.CrmService30.Req uest'.
at
System.Web.Services.Protocols.SoapHttpClientProto col.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)

The type listed in the exception is interchangable and will occur on every
type I pass or receive. I give you another example here:

System.Web.Services.Protocols.SoapException: Server was unable to process
request.
---> There was an error generating the XML document.
---> Unable to cast object of type
'muellerPrange.MediaCRM.Provider.CrmService30.Cal lerId' to type
'muellerPrange.MediaCRM.Provider.CrmService30.Cal lerId'.
at
System.Web.Services.Protocols.SoapHttpClientProto col.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)

As you can see, the source and target types of the exception are identical.
It reads like "Cannot convert int to int", though this is a bad example
because int is a value type. However, I cannot work around this issue. I
thought that this may be related to impersination issues, but as far as I can
tell, credentials are passed correctly.

I'm still using the September CTP build of VS2005 and SQL Server 2005 (.NET
Framework version 2.0.50727), because I'm not able to access the MSDN
subscriber downloads since a week or so).

I saw some related posts in this newsgroups and wonder, if this is a bug in
the 2.0 Framework that may already have been fixed in the final version.

Any ideas?

Thanks,
Michael

Nov 23 '05 #2
If found it. It in fact is a problem with the dynamic assembly loading.
After adding a reference to the CRM provider assembly and directly creating
an instance instead of using Assembly.CreateInstance(), the exception is
gone and everything works fine. I still don't know what causes this problem,
bu it looks as if ASP.NET creates classes for the CRM server types on the
fly when loading the assembly dynamically. Though I'm happy that it works
now, if anyone can explain what really is going on under the hood, I'm very
interested to read it.

Thanks
Michael

"Michael Höhne" <mi************@nospam.nospam> schrieb im Newsbeitrag
news:%2***************@TK2MSFTNGP10.phx.gbl...
Hi Marvin,

currently I have the following setup:

CRM Server defines the types listed in the exceptions (WhoAmIRequest,
Request, CallerId) and makes it available through its WSDL.

I have an assembly (class library, the CRM Provider) referencing this
WSDL. It's a wrapper exposing some methods to access the CRM services in a
unique way (I use that concept because there will be more systems I have
to talk to using the same provider interfaces and the provider assemblies
encapsulate the specific implementations). The CRM provider assembly is
the only piece of code knowing about the CRM server types and it converts
the CRM types to other types that I use in the service providers.

If a method in my own web service is called, a configuration table is
evaluated to get the information which provider assembly to load and how
to connect to the appropriate service. Right now the CRM provider assembly
is the only exisiting provider, but it may be important to know that it is
loaded dynamically, meaning that there's no reference to the CRM provider
assembly in my own web service. This web service also doesn't know
anything about the existance of the CRM server and it's data types - at
least not at compile time. I'm wondering if something happens at runtime,
when the provider assembly is loaded.

The client application uses another provider assembly (let's call it
MyProvider), which encapsulates the calls to our own web service. This
allows me to define code like the following:

//Directly call the CRM server
IServiceProvider provider = GetProvider("MSCRM");
provider.Logon("crmserver");
provider.DoSomething();
--> this works

//Call our own system and let it decide where to retrieve the data from
IServiceProvider provider = GetProvider("MyProvider");
provider.Logon("crmsql:4444"); -> calls our web service, which will then
call the CRM server using the same code as above
provider.DoSomething();
--> this does not work and generates the mentioned exceptions

MyProvider is the only assembly having a reference to our web service, so
all the internals are hidden. Any application will simply use the
IServiceProvider interface to access methods, without knowing the type of
system being used.
If I understand your answer correctly, you are thinking about the problem
when referencing a WSDL in more than one project, which in fact will
create two distinct types for each class, though identical. I don't see a
that problem, because the compiler would tell me. But as said before, it
feels as if there's something going on at runtime. To check it out, I will
simply replace the dynamic loading of the CRM provider assembly with a
fixed reference to see if it makes any change.

Please excuse if I have misunderstood your iniital idea. I appreciate any
help that points me to the cause of this problem because I'm really stuck.

Thanks
Michael
"Marvin Smit" <ma*********@gmail.com> schrieb im Newsbeitrag
news:3h********************************@4ax.com...
Hi,

one question popped in my mind;

Which programms (Client, WebService impl & CRM system) have a
reference to the ".Net" type of the dataclasses (Request/WhoAmIRequest
etc) assmbly?

The fun part is that the datatype used (on the wire) must be the same,
but in theimplementations.......

The datatypes used in the client => Generated from WSDL
The datatypes used in the WebService => Propagated types from the CRM
system (i assume).
The datatypes used in the CRM => native types?

Hope this helps,

Marvin Smit.
On Tue, 8 Nov 2005 02:09:02 -0800, "Michael Hoehne"
<mi************@nospam.nospam> wrote:
Hi,

I'm currently facing a problem with a mixed environment using .NET 1.1
and
.NET 2.0 web services.

We have a client application (the "client", system 1) running on .NET
2.0/WinXP, calling our web service (The "Web Service Server") running on
a
separate machine (also .NET 2.0, Win2003 Server, system 2).

The web service server (system 2) itself makes calls to methods in the
CRM
3.0 Server (the "CRM server", CRM 3.0 EAP, system 3), which is built on
.NET
1.1. The CRM server also is a separate machine.

All systems are in the same domain and the user I'm testing with has
administrative rights and valid logons.

My current situation is the following:
Calling the CRM server (3) web services directly from either the client
(1)
or the web service server (2) works without any problem.
Calling the Web service server (2) from the client (1) also works without
problems.
Making a call to the CRM server (3) from within a web service method of
the
web service server (2) when called from the client (1) fails with the
following exception message:

System.Web.Services.Protocols.SoapException: Server was unable to process
request.
---> There was an error generating the XML document.
---> Unable to cast object of type
'muellerPrange.MediaCRM.Provider.CrmService30.W hoAmIRequest' to type
'muellerPrange.MediaCRM.Provider.CrmService30.R equest'.
at
System.Web.Services.Protocols.SoapHttpClientPro tocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)

The type listed in the exception is interchangable and will occur on
every
type I pass or receive. I give you another example here:

System.Web.Services.Protocols.SoapException: Server was unable to process
request.
---> There was an error generating the XML document.
---> Unable to cast object of type
'muellerPrange.MediaCRM.Provider.CrmService30.C allerId' to type
'muellerPrange.MediaCRM.Provider.CrmService30.C allerId'.
at
System.Web.Services.Protocols.SoapHttpClientPro tocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)

As you can see, the source and target types of the exception are
identical.
It reads like "Cannot convert int to int", though this is a bad example
because int is a value type. However, I cannot work around this issue. I
thought that this may be related to impersination issues, but as far as I
can
tell, credentials are passed correctly.

I'm still using the September CTP build of VS2005 and SQL Server 2005
(.NET
Framework version 2.0.50727), because I'm not able to access the MSDN
subscriber downloads since a week or so).

I saw some related posts in this newsgroups and wonder, if this is a bug
in
the 2.0 Framework that may already have been fixed in the final version.

Any ideas?

Thanks,
Michael


Nov 23 '05 #3
ruchi shrivastava
1 New Member
Hi,

Could you please let me know if there are any changes in the format of WSDL file used by .NET 1 and .Net2.



Hi,

I'm currently facing a problem with a mixed environment using .NET 1.1 and
..NET 2.0 web services.

We have a client application (the "client", system 1) running on .NET
2.0/WinXP, calling our web service (The "Web Service Server") running on a
separate machine (also .NET 2.0, Win2003 Server, system 2).

The web service server (system 2) itself makes calls to methods in the CRM
3.0 Server (the "CRM server", CRM 3.0 EAP, system 3), which is built on .NET
1.1. The CRM server also is a separate machine.

All systems are in the same domain and the user I'm testing with has
administrative rights and valid logons.

My current situation is the following:
Calling the CRM server (3) web services directly from either the client (1)
or the web service server (2) works without any problem.
Calling the Web service server (2) from the client (1) also works without
problems.
Making a call to the CRM server (3) from within a web service method of the
web service server (2) when called from the client (1) fails with the
following exception message:

System.Web.Services.Protocols.SoapException: Server was unable to process
request.
---> There was an error generating the XML document.
---> Unable to cast object of type
'muellerPrange.MediaCRM.Provider.CrmService30.WhoA mIRequest' to type
'muellerPrange.MediaCRM.Provider.CrmService30.Requ est'.
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)

The type listed in the exception is interchangable and will occur on every
type I pass or receive. I give you another example here:

System.Web.Services.Protocols.SoapException: Server was unable to process
request.
---> There was an error generating the XML document.
---> Unable to cast object of type
'muellerPrange.MediaCRM.Provider.CrmService30.Call erId' to type
'muellerPrange.MediaCRM.Provider.CrmService30.Call erId'.
at
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)

As you can see, the source and target types of the exception are identical.
It reads like "Cannot convert int to int", though this is a bad example
because int is a value type. However, I cannot work around this issue. I
thought that this may be related to impersination issues, but as far as I can
tell, credentials are passed correctly.

I'm still using the September CTP build of VS2005 and SQL Server 2005 (.NET
Framework version 2.0.50727), because I'm not able to access the MSDN
subscriber downloads since a week or so).

I saw some related posts in this newsgroups and wonder, if this is a bug in
the 2.0 Framework that may already have been fixed in the final version.

Any ideas?

Thanks,
Michael
Jul 1 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Amadrias | last post by:
Hi all, I am using a class to transport some data over the network. I then added the attribute to the class. My problem is that this class is part of a framework and that I do not want...
0
by: HakonB | last post by:
Hi all I get an exception when trying to deserialize a simple configuration file using XML Serialization. The very long stacktrace can be seen at the bottom of this message. I've see other...
5
by: Perecli Manole | last post by:
I have a class that has been serialized and saved to disk. I am trying to deserialize it back into the same class which now has an extra private member. It will not deserialize because its...
27
by: Codemonkey | last post by:
Heya All, Sorry, but I think it's about time for a monkey-ramble. I've just had enough of trying to serialize even simple objects with VB. A simple task you may think - stick the...
2
by: Luck | last post by:
Hi, I really need some expert help... please! Basically, I need to serialize a data structure object to a file using SOAP and then load and de-serialize that file in ANOTHER program. When I...
1
by: elziko | last post by:
I have a class that contains a field that is a System.Drawing.Pen. I need to be able to serialize the class but since the .NET Framework does not have the Pen marked as serializable I must create a...
2
by: =?ISO-8859-1?Q?=22Andr=E9s_G=2E_Aragoneses_=5B_kno | last post by:
Hello. I have this kind of object: class classA { int x; classA z; public int X { get { return this.x; }
4
by: mijalko | last post by:
Hi, I have inherited my class from System.Drawing.Printing.PrintDocument and I wish to serialize this object using XmlSerializer. And I get exception "There was an error reflecting type ...". If I...
4
by: camarkco | last post by:
Why does C# go out of it's way to prevent this? Mark
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.