Omit namespace from xml fields-level from a wcf web service



I have a C# 4.0 WCF web service that passes a SOAP response back to a calling SSIS package. The Package cannot seem to read the returned object, apparently b/c the default service response has added namespaces to the fields (I know, usually a good thing, but not in this case.)


How do I get rid of the namespaces internal to the XML for my SSIS customer?


This is the response object as defined:



[DataContract]
public class NewLoanNumberResult
{
[DataMember]
public int ErrorCode { get; set; }
[DataMember]
public string ErrorText { get; set; }
[DataMember]
public string LoanNumber { get; set; }


public NewLoanNumberResult()
{
this.ErrorCode = 0;
this.ErrorText = string.Empty;
this.LoanNumber = "";
}
}


The web service is defined like this:



namespace NewLoanNumber
{
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed), Guid("23618A5F-A903-4612-96F7-E28F962CE304")]
[ServiceContract(Namespace = "http://ift.tt/1rmn0oV")]
public class WCFNewLoanNumber
{
[OperationContract]
public NewLoanNumberResult GetNewLoanNumber(string userID)
{
NewLoanNumberResult retValue = new NewLoanNumberResult();
try
{
CommonLogger.LogProcess(userID, "GetNewLoanNumber", userID);
NewLoanNumberHandler nln = new NewLoanNumberHandler(userID);
retValue.ErrorCode = nln.ErrorCode;
retValue.ErrorText = nln.ErrorText;
retValue.LoanNumber = nln.LoanNumber;
CommonLogger.LogProcess(userID, "GetNewLoanNumber", userID, retValue.LoanNumber);
}
catch (Exception ex)
{
CommonLogger.LogException(ex, "NLN Webservice", false, CommonLogger.Priority.Normal);
}

return retValue;
}

}
}

No comments:

Post a Comment