none
Issue in migrating from 1.1 .Net webservices to 4.0 .Net webservices RRS feed

  • Question

  • Hi,

    We are migrationg our services from .Net 1.1 framework webservices to .Net 4.0 framework webservices. We are not doing any change in code/functional wise except framework runtime.

    The issue here is, the order of list has differnece when comapre with 1.1 response and 4.0 response.

    1.1 Resonse

    <Lists>
    <list>
    <Name>Pavan</Name>
    </list>
    <list>
    <Name>Kumar</Name>
    </list>
    <list>
    <Name>Chebrolu</Name>
    </list>
    </Lists>

    Where as 4.0 reponse shown as below(only order was changed)

    <Lists>
    <list>
    <Name>Chebrolu</Name>
    </list>
    <list>
    <Name>Kumar</Name>
    </list>
    <list>
    <Name>Pavan</Name>
    </list>
    </Lists>

    Please share your thoughts on this.

    Regards

    Pavan

    Friday, January 18, 2013 9:36 AM

All replies

  • Are you sure the lists are equal before serialization?

    What is the source of the values?


    Paulo Morgado

    Friday, January 18, 2013 9:47 AM
  • Yes Morgado
    Saturday, January 19, 2013 3:11 PM
  • Have you tried to build a very small stand alone service to see if the behavior is the same?

    Paulo Morgado

    Sunday, January 20, 2013 12:07 AM
  • Hi, I suspect the default order of this two are different.

    And with WCF, you can identify the order of the data member the default value is -1.

     [DataMember(Order = 1)]
     public string Name { get; set; }
    


    Monday, January 21, 2013 7:34 AM
  • According to the documentation (http://msdn.microsoft.com/library/ms584760.aspx) the Order property defines the order of the data member in the data contract.

    I don't think it's the problem here.


    Paulo Morgado

    Monday, January 21, 2013 11:48 AM
  • Hi,

    Are you getting this list from web service, after executing any kind of  Database Query ? If the ans is yes. I might be the cause of OrderBy clause. If you don't put any orderby clause in your T-SQL query. Then sql server sort query result as per physical page file order. So put orderBy clause in your SQL Query. You will always get same shorting order. 

    Note: If not any other kind of error.

    Happy Coding.

    Thanks,


    Knight Data Access Layer - .NET ORM, LINQ Provider, and more https://www.kellermansoftware.com/p-47-net-data-access-layer.aspx


    • Edited by radcorpindia Tuesday, February 12, 2013 12:53 PM
    Tuesday, February 12, 2013 12:52 PM