Problems generating Proxy-Class - wrong names

Jun 18, 2008 at 9:56 AM
In a WCF-webservice I have a problem with generating one proxy-class.
In this proxy-class the names of the generated collections (dictionaries) is duplicated.
So it is now entitydatacontractcollectionentitydatacontractcollection instead of
entitydatacontractcollection. This happens at exactly one proxy of five and i can't
find out the difference between this one and the rest.

Did anybody ran into the same problems and can help me?

thx

Klaus
Developer
Jun 18, 2008 at 4:09 PM
Unfortunately I was not able to reproduce your scenario. Can you please verify if the svcutil tool generates the same output proxy class for that service? This would guide us to where the problem could be.

Thanks




kr2005 wrote:
In a WCF-webservice I have a problem with generating one proxy-class.
In this proxy-class the names of the generated collections (dictionaries) is duplicated.
So it is now entitydatacontractcollectionentitydatacontractcollection instead of
entitydatacontractcollection. This happens at exactly one proxy of five and i can't
find out the difference between this one and the rest.

Did anybody ran into the same problems and can help me?

thx

Klaus



Jun 19, 2008 at 6:58 AM
I am afraid I know now why this happen:

http://blogs.msdn.com/sonuarora/archive/2007/06/16/contract-generation-from-wsdl-xml-schema-datacontractserializer-vs-xmlserializer.aspx


I just don't know what is wrong with those files.


charlyfriend wrote:
Unfortunately I was not able to reproduce your scenario. Can you please verify if the svcutil tool generates the same output proxy class for that service? This would guide us to where the problem could be.

Thanks




kr2005 wrote:
In a WCF-webservice I have a problem with generating one proxy-class.
In this proxy-class the names of the generated collections (dictionaries) is duplicated.
So it is now entitydatacontractcollectionentitydatacontractcollection instead of
entitydatacontractcollection. This happens at exactly one proxy of five and i can't
find out the difference between this one and the rest.

Did anybody ran into the same problems and can help me?

thx

Klaus






Jun 24, 2008 at 2:29 PM
I have been able to reproduce this misbehaviour:

I have a DataContract named AttributeStringDataContract with members like AttributeType, AttributeSetID and so on.
Furthermore i have operations like GetAttributeSet, InsertAttributeSet and UpdateAttributeSet.

At the moment i insert datacontract and servicecontract, the datacontractserializer fails in generating the proxy-class.
Developer
Jun 24, 2008 at 3:20 PM
Form your description, it seems that your types does not support DataContractSerializer and therefore you may need to use the XmlSerializer.
If you do this, you still get the proxy error?
Jun 24, 2008 at 4:09 PM
Sorry. that has been exactly my problem. I'm using dictionaries which aren't supported by the xml-serialization.
now everythings fine with datacontractserializer as long as the names do not contain "Attribute".
If  i understand it right xml-serializer is fallback for datacontractserializer. The previously mentioned effect
with wrong-named seems to depend on xml-serialization of complex types.

Jun 27, 2008 at 4:06 PM
Edited Jun 30, 2008 at 10:02 AM
In the meantime i am not sure if the problem is really the name attribute, because i became the same problem calling it "feature",
although i haven't found another reason. What i have found is a workaround: 
The workaround is to:
-Work with the service-contract.
-Save the service-contract.
-open service-contract with notepad.
-make sure that objectExtenderContainer-Values are same for:
-Service and Service-Contract as well as for:
Message and Messagepart.
-Save service-contract again.
-open service-contract in VS.
-Validate all.
-generate code.
-proceed as usual.

really dirty in my eyes but it works.
 what exactly is the objectExtenderContainer for and for what reasons it's values can be wrong.
Respectivley for what reasons there could be différent values for service and service-contract or for
message and messagepart, when they should be obvioulsy the same .All DataContract and ServiceContract
work fine and without problems but this one.

What i didn't notice before:
I get warnings :" Invalid property value 'AAEAAAD...L' for property 'objectExtenderContainer' with type 'ObjectExtenderContainer', ignored" and i get similar warnings after i made the above mentioned changes, too.
Developer
Jun 30, 2008 at 9:37 PM
The objectExtenderContainer stores the values for the different extender properties associated with the Implementation Technology chosen. Based on the original problem you were having and the warnings that you are getting, I'm afraid that you may have to manually erase the values of the objectExtenderContainer xml property and set them again through the designer but this time using the correct serializer. There might be some invalid data from a previous fallback serialization (to binary) which is not compatible with the XmlSerializer.

Thanks
Jul 1, 2008 at 12:00 PM
thx a lot charlyfriend.

Looks like that is the clean solution. I erased all objectExtenderContainer-values as well in the datacontract as in the servicecontract.
After that i had to reenter the order-property for datacontracts and collection type for datacontract-collection.
At the service-contract i had to reenter the iswrapped-property of messages.

but after that with generating the code, rebuild and generate the proxy-class everything went fine.