///<summary>Sends a WebServiceTestObject across middle tier and returns it to the client.</summary> public static WebServiceTestObject GetAndSendObjectWithListLongs(WebServiceTestObject testObj) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { return(Meth.GetObject <WebServiceTestObject>(MethodBase.GetCurrentMethod(), testObj)); } return(testObj); }
///<summary>There was a bug where the middle tier would escape special XML characters for HTTP transmission too much. ///This would happen if an instance of an object was reused multiple times within the return value of the method. ///E.g. The Appointments.ApptSaveHelperResult class has an appointment object and a list of appointments. The real life scenario that exposed ///this bug was that a new appointment object was inserted into the database, set to the appointment object on the return object and then added ///to the list of appointments that was also part of the return object. The middle tier then escaped strings on the appointment object too many ///times because the same object was getting manipulated each time it was referenced within the recursive XML escape loop.</summary> public static WebServiceTestObject GetPrimitiveReused(WebServiceTestObject testObj) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { return(Meth.GetObject <WebServiceTestObject>(MethodBase.GetCurrentMethod(), testObj)); } //This specific method needs to set ValueStr2 and set it to ValueStr in order to "reuse" the primitive (string). testObj.ValueStr2 = testObj.ValueStr; return(testObj); }
///<summary>There was a bug where the middle tier would escape special XML characters for HTTP transmission too much. ///This would happen if an instance of an object was reused multiple times within the return value of the method. ///E.g. The Appointments.ApptSaveHelperResult class has an appointment object and a list of appointments. The real life scenario that exposed ///this bug was that a new appointment object was inserted into the database, set to the appointment object on the return object and then added ///to the list of appointments that was also part of the return object. The middle tier then escaped strings on the appointment object too many ///times because the same object was getting manipulated each time it was referenced within the recursive XML escape loop.</summary> public static List <WebServiceTestObject> GetObjectReused(WebServiceTestObject testObj) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { return(Meth.GetObject <List <WebServiceTestObject> >(MethodBase.GetCurrentMethod(), testObj)); } return(new List <WebServiceTestObject>() { testObj, testObj }); //Reuse the object passed in within the return value. }