views:

187

answers:

1

After creating a new ASP.NET Web Service I want it only to support HTTP-POST for incoming data. How can I force the WSDL to reflect that policy?

How should the WSDL for the clients look like to enable only HTTP-POST and disallow SOAP 1.1 and SOAP 1.2 in the WSDL?

The solution:

<system.web>
<webServices>
  <protocols>
    <clear />
    <add name="HttpPost"/>
    <add name="Documentation"/>
  </protocols>
  <conformanceWarnings>
    <remove name='BasicProfile1_1'/>
  </conformanceWarnings>
</webServices>
A: 

See this answer: http://stackoverflow.com/questions/1276098/is-it-possible-to-restrict-certain-asmx-web-service-methods-to-get-or-post-only

[ScriptMethod(UseHttpGet = false)]

Edit - more info

Have you tried this in your web.config?

<configuration>
   <system.web>
      <webServices>
         <protocols>
            <clear />
            <add name="HttpPost"/>
         </protocols>
      </webServices>
   <system.web>
</configuration>

This idea came to me after reading this documentation:

http://msdn.microsoft.com/en-us/library/ccbk8w5h(VS.85).aspx

David Stratton
Yet can the protocols be configured within code via c# attributes?
zproxy
I wasn't able to find any documented way of doing that. The web.config solution was the only one I could find for what you were asking.
David Stratton