问题
Why is it that for some of my web-services, I get test forms so I can see the generated xml data, but for other web-services, I get a message saying The test form is only available for requests from the local machine.
?
Both times, I am connecting to the URL of the web-service from a client side browser and all web-services are created with C#, .NET-3.5.
回答1:
I googled for "The test form is only available for requests from the local machine."
There were many results, and the consensus is to add these nodes to the web.config of the web service. I haven't tried this solution yet, but you can check to see if your web services that shows the test form remotely has this that have these nodes in the web.config. Or, you can add it to the web services that give this message and see if the test form starts appearing remotely.
<configuration>
<system.web>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
</system.web>
</configuration>
Here are some of the search results
- StackOverflow: The test form is only available for requests from the local machine.
- GeeksWithBlogs: "The test form is only available for requests from the local machine"
- Microsoft support: INFO: HTTP GET and HTTP POST Are Disabled by Default
来源:https://stackoverflow.com/questions/13234819/the-test-form-is-only-available-for-requests-from-the-local-machine