简体   繁体   中英

Invalid SOAP request: HTTP method 'GET' is not POST

I'm calling a (php) webservice (from ClearPass ArubaNetworks) in C#.

But I'm getting an Exception complaining about 'Invalid SOAP request: HTTP method 'GET' is not POST'

Has someone an idea what the problem could be?

Thanks!

EDIT (included code)

using (GuestManagerWebServiceClient client = new GuestManagerWebServiceClient())
        {
            client.ClientCredentials.UserName.UserName = "*********";
            client.ClientCredentials.UserName.Password = "*********";

            EmptyType pingRequest = new EmptyType();
            ResultType pingResponse = client.Ping(pingRequest);

            Console.WriteLine("error: {0}, message: {1}", pingResponse.error, pingResponse.message);
            Console.ReadLine();
        }

GET and POST are two of the major HTTP methods. GET is generally for requesting data, and only expects a simple URL, perhaps with parameters. While it has come to be used for other things, it was not intended for changing server state.

A POST represents data posted back and normally includes an attachment of data to be sent to the server that the server can act on or store somewhere.

When making an http request - it is generally one of these methods - although there are a couple more that are not used as commonly.

For a (much, much better) explanation than mine - see this - http://www.w3schools.com/TAGS/ref_httpmethods.asp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM