Connecting Tech Pros Worldwide Forums | Help | Site Map

Serialization issues using .NET Framework 2.0?

Michael Hoehne
Guest
 
Posts: n/a
#1: Nov 23 '05
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


Marvin Smit
Guest
 
Posts: n/a
#2: Nov 23 '05

re: Serialization issues using .NET Framework 2.0?


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"
<michael.hoehne@nospam.nospam> wrote:
[color=blue]
>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[/color]
Michael Höhne
Guest
 
Posts: n/a
#3: Nov 23 '05

re: Serialization issues using .NET Framework 2.0?


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" <michael.hoehne@nospam.nospam> schrieb im Newsbeitrag
news:%23m2iuPS5FHA.620@TK2MSFTNGP10.phx.gbl...[color=blue]
> 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" <marvin.smit@gmail.com> schrieb im Newsbeitrag
> news:3hm3n15jf5fh2v0ksfr145q5fua62impis@4ax.com...[color=green]
>> 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"
>> <michael.hoehne@nospam.nospam> wrote:
>>[color=darkred]
>>>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[/color][/color]
>
>[/color]


Newbie
 
Join Date: Jul 2006
Posts: 1
#4: Jul 1 '06

re: Serialization issues using .NET Framework 2.0?


Hi,

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



Quote:

Originally Posted by Michael Hoehne

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

Closed Thread