0

When i Deserlize soap xml, i am getting Status and Token attribute value Null.How can i solve this problem. How to assign xattribute and Xelement values in model.How to use xml serlize in wcf service.

I have Soap XML below

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
  <ResponseId xmlns="http://www.googlr.com/DDDls/"/>
</soap:Header>  
  <soap:Body>
  <ns3:NotifRQ Status="winner" value="dfdfdfdf    
      xmlns:ns2="http://www.googlr.com/gggg/"                            
     xmlns:ns3="http://www.opentravel.org/OTA/2003/05/beta">
   </ns3:NotifRQ>
    </soap:Body>
    </soap:Envelope>

Model:

[DataContract(Name = "Envelope", Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]
public class Envelope
{
    [DataMember(Name = "Body", Order = 0)]
    public EnvelopeBody Body;
}

[DataContract(Name = "Body", Namespace = "http://www.opentravel.org/OTA/2003/05/beta")]
public class EnvelopeBody
{
    [DataMember(Name = "OTA_HotelResNotifRQ")]
    public NotifRQ NotifRQ;

}

[DataContract(Name = "NotifRQ", Namespace = "http://www.opentravel.org/OTA/2003/05/beta")]
public class NotifRQ 
{
    [DataMember(Name = "Status")]
    public string Status;

    [DataMember(Name = "value")]
    public string value;
  }


[ServiceContract]
public interface IPush
{
    [OperationContract]
    [WebInvoke(Method = "POST", UriTemplate = "Details", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
    Ackn GetBookingDetails(Details obj);

    [OperationContract]
    [WebInvoke(Method = "POST", UriTemplate = "Response", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Bare)]
    Response GetResponse(Envelope respxml);
  }

How to serlize xml and how to get xatttibute value??

prakash
  • 1
  • 3

0 Answers0