none
WCF Serialisation Postfix ocH4mRuO RRS feed

  • Question

  • Hi All

    I have a question about serialization in WCF. When I serialize an Generic Object like VoList<FunctionCatalogEntryLanguageVO> .NET adds a postfix in the SOAP to the Type. For this example it creates SOAP like this:

    <m_oDependentVOLists xmlns="http://schemas.datacontract.org/2004/07/Ibs.Platform.VO" xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <b:KeyValueOfanyTypeanyType>
    <b:Key i:type="c:int" xmlns:c="http://www.w3.org/2001/XMLSchema">1</b:Key>
    <b:Value i:type="c:VoListOfFunctionCatalogEntryLanguageVOocH4mRuO" xmlns:c="http://schemas.datacontract.org/2004/07/Ibs.Platform">
    <c:DoNotUseDataContractDataMemberInnerList></c:DoNotUseDataContractDataMemberInnerList>
    <c:DoNotUseDataContractDataMemberRemovedList></c:DoNotUseDataContractDataMemberRemovedList>
    </b:Value>
    </b:KeyValueOfanyTypeanyType>
    </m_oDependentVOLists>
    

    Here you can see the Type is now VoListOfFunctionCatalogEntryLanguageVOocH4mRuO. This postfix is different from Webservice to Webservice.

    My Question are:

    1. From where does this Postfix come from?
    2. Is it based on something from the DLL? 
    3. Can I get rid of this?
    4. Can I make them the some offer all Webservice

    I need this for a Projekt where I have to write my own SOAP via a Factory.

    THX for Help and best regard

    Michael


    MK

    Monday, June 16, 2014 7:55 AM

All replies

  • Hi,

    The following article has told that why it uses the VoListOfFunctionCatalogEntryLanguageVOocH4mRuO instead of just VoListOfFunctionCatalogEntryLanguageVO.

    For more information, please try to refer to:
    #Funny *field Postfix in WCF Reference:
    http://geekswithblogs.net/mipsen/archive/2010/02/06/field-postfix-in-wcf-reference.aspx .

    Then if you want to get rid of it, please try to check the following:

    WCF uses the XmlObjectSerializer by default to handle serialization of the data contracts. If you use XML based data contracts you might consider using the XmlSerializer instead. The fields in the reference will be named as expected.

    More information about using XmlSerialzer can be found here .

    If you want to tell WCF to use XmlSerializer, you can apply the attribute [XmlSerializerFormat] to the operation or even the service in the interface.

    Example:

    [ServiceContract(Namespace="http://somenamespace.com/contracts")]    
         public interface ISchemaService
         {
             [OperationContract]
             [XmlSerializerFormat]
            void DoSomething(GeneratedType data);
         }

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, June 17, 2014 5:29 AM
    Moderator
  • Hi Amy

    that goes in the correct direction, but the XMLSerializer isn't really an option for me. I have to find out how WCF is generating the ocH4mRuO so that a can generate this at runtime. This has to come from the DLL where the Service is in. When you have two Service, that are in the some DLL, they have the some Postfix. When they come from an different DLL they have a differnet postfix.

    Any Idee on this?

    Michael


    MK

    Tuesday, June 17, 2014 8:01 AM
  • Does now one have an Idea where Microsoft get this ocH4mRuO from?

    I need this.

    Regards

    Michael


    MK

    Tuesday, June 24, 2014 6:53 AM
  • Does you field has one? it should comes with your field.
    Tuesday, June 24, 2014 6:55 AM
  • what does you meen by field => Assembly => Solution?

    MK

    Tuesday, June 24, 2014 6:57 AM