0

Our clients want to use the following soap message to call my WCF Service:

<soapenv:Envelope .....>
<soapenv:Header />
<soapenv:Body>
  <st:myExtraParam>str ex</st:myExtraParam>
  <st:MyMethod>
    <st:myfuncParam>func str</st:myfuncParam> 
  </st:MyMethod>
  ....
  ....
</soapenv:Body>
</soapenv:Envelope>

I created my service contract like the following:

[ServiceContract]
public interface IMyService
{
   [OperationContractAttribute]
   public ResponseObj MyMethod(string myfuncParam)
}

Now, how can I enable <st:myExtraParam>param str</st:myExtraParam> parameter above the function tag?

Fer
  • 1,962
  • 7
  • 29
  • 58

1 Answers1

0

My first instinct was to say that one can't have more than one direct child element of the SOAP Body element. But the SOAP specification says that it's fine to do so.

I don't think that WCF, based on [ServiceContract], can do it, though.

PeteAC
  • 789
  • 8
  • 19
  • Because SOAP specification says that we can use more than one child under SOAP Body element, I cannot force my client not to use the XML described on my question. So I am still trying to make a solution. – Fer Mar 07 '16 at 07:25