C # A 500 server error occurs when Java WebService is called,
When I recently used C # To call the WebService written in Java, I found that the 500 server error is always returned. Why can't I find it,
After google, find a foreign http://stackoverflow.com site has encountered this problem.
The post is as follows:
HttpWebRequest req = WebRequest.Create(url) as HttpWebRequest;WebResponse wr = req.GetResponse();
When the server returns 500 Internal Server Error, exception is thrown in req. getResponse (). I wowould like the GetResponse () to accept this Response Code, it is normal for the passed url to throw this Response Code. I wowould like to parse the Html despite Response Code 500 Internal Server Error. is it possible to say to GetResponse () method not to verify the Response Code?
Answer:
try{ HttpWebRequest req = WebRequest.Create(url) as HttpWebRequest; WebResponse wr = req.GetResponse();}catch (WebException wex){ var pageContent = new StreamReader(wex.Response.GetResponseStream()) .ReadToEnd();}
You can use the above Code to query specific error information and further solve the problem.
Original post address:
Http://stackoverflow.com/questions/18403846/httpwebrequest-accept-500-internal-server-error
Symbol in C Language <Yes
Left shift operator (<)
Removes all the binary bits of an operation object from the left and adds 0 to the right ).
For example, a = a <2 shifts the binary bits of a two places to the left and complements 0 to the right,
Move 1 to the left and then a = a * 2;
If the left shift does not include 1 in the Discard high position, then shifts one bit left, which is equivalent to multiplying the number by 2.
Shift right operator (>)
Shifts all the binary bits of a number to several places to the right, and adds 0 to the left of the positive number, 1 to the left of the negative number, and discards the right of the negative number.
The operand shifts one digit to the right, which is equivalent to dividing the number by 2.
For example, a = a> 2 shifts the binary bit of a two places to the right,
0 or 1 to see whether the number is positive or negative.
Symbol in C Language <Yes
Left shift operator (<)
Removes all the binary bits of an operation object from the left and adds 0 to the right ).
For example, a = a <2 shifts the binary bits of a two places to the left and complements 0 to the right,
Move 1 to the left and then a = a * 2;
If the left shift does not include 1 in the Discard high position, then shifts one bit left, which is equivalent to multiplying the number by 2.
Shift right operator (>)
Shifts all the binary bits of a number to several places to the right, and adds 0 to the left of the positive number, 1 to the left of the negative number, and discards the right of the negative number.
The operand shifts one digit to the right, which is equivalent to dividing the number by 2.
For example, a = a> 2 shifts the binary bit of a two places to the right,
0 or 1 to see whether the number is positive or negative.