Click here to Skip to main content
16,016,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a wcf web service which i am calling from my asp.net code, but its giving me an error because i am not passing one object of class. how to handle this?


protected void btnSubmit_Click(object sender, EventArgs e)
{
/*This section is not working as i am not passing ts.txnErrorDetails */
C#
bool b;
            PolicyUpdate.ServiceClient req = new PolicyUpdate.ServiceClient();
            PolicyUpdate.TxnStatus ts = new PolicyUpdate.TxnStatus();
            ts.TxnId = "1";
            ts.Status = "Success";
            ts.TxnStatusDetail = new PolicyUpdate.TxnDetail { ContactId = 111111111, PolicyNo = 925101789012340000, ProposalNo = 12345678901234, ReceiptNo = 123456789123 };
            
            b = req.UpdateStatus(ts);


/* This section is working as i am passing ts.txnErrorDetails*/
C#
ts.TxnId = "1";
          ts.Status = "UW";
          ts.TxnStatusDetail = new PolicyUpdate.TxnDetail { ContactId = 111111111, ProposalNo = 12345678901234, ReceiptNo = 123456789123 };
          ts.TxnErrorDetails = new PolicyUpdate.ErrorDetail { ErrorLevel = "Policy", Details = "Proposal Pending for UW Approval" };
          b = req.UpdateStatus(ts);

}
Posted
Comments
SPASWIN 11-Jun-13 11:14am    
Could you ShowMe the Model/Class...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900