Click here to Skip to main content
16,016,180 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I create a web method "Opn" in WCF and the envelop looks like the below.

XML
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">urn:IEhelplineService/Open</Action>
  </s:Header>
  <s:Body>
    <Open>
      <header xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <applicationID i:nil="true" />
        <feedbackMode i:nil="true" />
        <sApplicationID i:nil="true" />
      </header>





Open is the web method and header is a parameter (Basically header is a class with datacontract attribute
specified)
applicationID,feedbackmode, and sApplicationID are properties of header class with datamember attribute specified.
Feedback mode is an object of another class with some more properties, how can i make it a wrapper element? I want the soap xml to look like
<Open>
  <header xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <applicationID i:nil="true" />
    <feedbackMode i:nil="true" />
       <mode></mode>
       <type></type>
    <sApplicationID i:nil="true" />
  </header>


How can i do it? I tried using message contract iswrapped. But it was not changing.
Posted
Updated 13-Jun-13 5:17am
v5
Comments
Sunasara Imdadhusen 13-Jun-13 7:46am    
Are you getting any error?

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