none
Web .Net Client have to communicate with WCF service, throught XML Request and Response RRS feed

  • Question

  • I'm trying to implement at WCF Service which can receive and send the XML and display the response on Client's website.  
     
    let me start development with online receiving XML on WCF project. 
     
    Step1-- For this I have created a WCF project. 
    Step2-- I have created a OptionContract and DataContract as below 
     
    **In Customers.cs file** 

        {
            [ServiceContract]
            public interface ICustomers
            {
                [OperationContract]
                FinishedProduct GetProductDetails(Product prod);
            }
            [DataContract]
            public class Customers
            {
                [DataMember]
                public string ID { get; set; }
                [DataMember]
                public string ProductCategory { get; set; }
            }
            [DataContract]
            public class CustomersDetails
            {
                [DataMember]
                public string ID { get; set; }
                [DataMember]
                public string Name { get; set; }
                [DataMember]
                public string Address1 { get; set; }
                [DataMember]
                public string Address2 { get; set; }
                [DataMember]
                public string Balance { get; set; }
            }
        }

    **XML Receive Format Would be** 

          <?xml version="1.0" encoding="UTF-8"?>
            <?OSX OSXHEADER="200" VERSION="201" SECURITY="NONE" OLDFILEUID="NONE" NEWFILEUID="NONE" ?>
            <Bank>
             <Customers>
               <ID>1234567890</ID>
              </Customers>
            </Bank>

     

    **XML Response Format Would be** 

        <?xml version="1.0" encoding="UTF-8"?>
        <?OSX OSXHEADER="200" VERSION="201" SECURITY="NONE" OLDFILEUID="NONE" NEWFILEUID="NONE" ?>
        <Bank>
         <Customers>
           <ID>1234567890</ID>
           <Name>1234567890</Name>
           <Addresss1>1234567890</Addresss1>
           <Addresss2>1234567890</Addresss2>
           <Balance>1234567890</Balance>
          </Customers>
        </Bank> 

    Step-3: 
    I was doing Google a lot to read the XML to implement the ICustomers interface. 
    Please any one can suggest me, what kind of steps I have to make to read the received XML and based on the received XML, How can I send response back to client server? 

    Friday, February 22, 2013 1:19 AM

Answers