How to force ASP.NET web service to expose only HTTP-POST interface

After creating a new ASP.NET web service, I want it to only support HTTP-POST for incoming data . How to get WSDL to display this policy?

How does WSDL for clients look like to enable only HTTP-POST and disable SOAP 1.1 and SOAP 1.2 in WSDL ?

Decision:

<system.web>
<webServices>
  <protocols>
    <clear />
    <add name="HttpPost"/>
    <add name="Documentation"/>
  </protocols>
  <conformanceWarnings>
    <remove name='BasicProfile1_1'/>
  </conformanceWarnings>
</webServices>
+3
source share
1 answer

See this answer: Is it possible to restrict certain methods of an ASMX web service to only GET or POST?

[ScriptMethod(UseHttpGet = false)]

Edit - More Information

Have you tried this in your web.config?

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

:

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

+1

Source: https://habr.com/ru/post/1727360/


All Articles