Hi Bhuvaneswari Vinayagamoorthi,
Thank you for the detailed information. Since the code works as expected in your local environment but not in the testing environment, the issue is likely due to configuration or environmental differences. Here are some steps to investigate:
1.Configuration Consistency: Ensure that the SoapCore configuration is identical across both environments, particularly settings related to serialization and any middleware that may affect the response format.
2.Deployment Verification: Confirm that the same version of the code has been deployed to the testing environment. Occasionally, deployment discrepancies can result in behavior that differs from the local setup.
3.Namespace Management: To eliminate unwanted namespaces (e.g., xmlns:xsi, xmlns:xsd), consider setting the Namespace property to an empty string in your DataContract:
[DataContract(Namespace = "")]
public class DestinationResponseNA
{
[DataMember] public string destnum { get; set; }
[DataMember] public string ucid { get; set; }
}
4.Encoding Considerations: Verify whether HtmlEncode() is influencing the response in the testing environment. If necessary, adjust or remove the encoding method as needed.
5.Logging and Debugging: Enable logging in the testing environment to capture and compare the actual response being returned with your local setup. This may provide further insight into any discrepancies.
If you have found the answer provided to be helpful, please click on the "Accept answer/Upvote" button so that it is useful for other members in the Microsoft Q&A community.