Problem:
This morning, after the WebService is deployed as a site, if you can test the WebService locally, "test form can only be used for requests from local computers" or "The test form is only available for requests from the local machine. ",
Cause:
As we all know, after the Web Service is ready and published on the Internet, when others want to call the interface you provide, they cannot open the test form, which makes many friends quite depressed, why can't I open the test form with the service interfaces provided by others? Is it mine?CodeIs there a problem with writing?This is because remote access is not enabled.
Solution:
Add the following configuration section in <system. Web> </system. Web> of Web. config:
<WebServices> <protocols> <Add name ="Httpsoap"/> <Add name ="Httppost"/> <Add name ="Httpget"/> <Add name ="Documentation"/> </Protocols> </WebServices>
analysis:
the following description is from msdn:
Asp is specified in protocols. net web service can be used to receive request data sent from the client and the protocol for returning response data. The protocol can be used to associate request data with methods and their parameters, and associate response data with methods and their return values. By default, only httpsoap and documentation are enabled. To use httppost and httpget, enable them as shown in the preceding example.
protocols sub-Meta (add, clear, remove)
Add -- add ASP. net web service can be used to receive request data sent from the client and the specified protocol for returning response data. By default, only httpsoap and documentation are enabled.
clear -- remove all protocols from the configuration file.
remove -- removes the specified protocol from the configuration file to process request and response data.