HTTP SOAP\GET\POST

后端 未结 2 1895
时光说笑
时光说笑 2021-01-13 08:54

I created my first web service 2 days ago in VS 2008 and was thinking about consuming it when I came across the following questions about web services:

1) My web ser

相关标签:
2条回答
  • 2021-01-13 09:20

    First of all, you may have made a mistake. Did you create a service with a .ASMX extension?

    That is a legacy "ASMX" web service, and should not be used for new development unless you have no choice. WCF should be used for all new development.

    Second, GET cannot be used to send complex types to the service, as it places the parameters into the query string. POST, is actually of little use, except for the test page (it also cannot send complex types).

    The only thing that really matters for such a service is SOAP. You should create a client application of some kind to test it, perhaps a set of unit tests.

    0 讨论(0)
  • 2021-01-13 09:23

    Standard SOAP services are using only HTTP POST because they require complex SOAP request (XML) which cannot be included in query string.

    When you want to make call to your SOAP service from web page, your page must built valid SOAP request. Because of that, SOAP calls are usually created from auto-generated service clients on server side.

    We can call it HTTP-SOAP because it is a SOAP request transported by the HTTP protocol with POST method.

    It doesn't take precedence. It is how SOAP services usually work. If you want to use HTTP GET and HTTP POST you should check REST services.

    0 讨论(0)
提交回复
热议问题