protocolexception

com.android.volley.NoConnectionError: java.net.ProtocolException: Unexpected status line: HTTP/1.1 401.3 Unauthorized

南楼画角 提交于 2020-01-07 05:39:13
问题 The following is my code. I got com.android.volley.NoConnectionError: java.net.ProtocolException: Unexpected status line: HTTP/1.1 401.3 Unauthorized. RequestQueue queue = Volley.newRequestQueue(this); String url = "http://echo.jsontest.com/key/value/one/two"; JsonObjectRequest getRequest = new JsonObjectRequest(Request.Method.GET, url, (String)null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { Log.e("LOG_VOLLEY","response : "+response.toString

Does System.ServiceModel.ProtocolException always have html code in its message?

 ̄綄美尐妖づ 提交于 2019-12-24 07:41:17
问题 Thats my question, I'm catching a few WCF exceptions on my client and the ProtocolException always has html code in its message. Could I assume that will happen every time? For what I see the real good message comes in the inner exception, could I just discard the ProtocolException message and show the user the message from the inner exception? 回答1: No, it doesn't always contain HTML in the message. Generally if there is HTML it's because the server your talking with (or through) hasn't

Throwing FaultException using Custom Exception Handler EL WCF

做~自己de王妃 提交于 2019-12-13 13:25:13
问题 So I'm trying to use Enterprise Library in my WCF service to do some of the exception-related work for me. My idea is to set up a " Custom Exception Handler " for say "NullReferenceException" and in the "Custom Exception Handler" create FaultException exception. My understanding is that this "new" exception will then make it across the wire and I will catch it at the client. Some code for better understanding: WCF service: [ServiceContract(Name="MyService", ConfigurationName="MyNamespace

Cannot write output after reading input; Experiencing this but not certain of cause

≯℡__Kan透↙ 提交于 2019-12-12 03:04:56
问题 I am experiencing this problem although not sure if exactly. I have discovered Cannot write output after reading input in logs and, per the above, I believe this is occurring because of a getResponseCode() followed by a getOutputStream() . Would this be the cause of the logged error I am seeing? HttpURLConnection conn = (HttpURLConnection) url.openConnection(); if(conn.getResponseCode() == 0){ logger.debug("Success"); } else { logger.debug("Time out set for 30 seconds"); } String input =

playframework ProtocolException invalid message

穿精又带淫゛_ 提交于 2019-12-12 02:48:44
问题 I have a funny phenomenon: If I start a blank index.html page with this controller: public class Application extends Controller { public static void index() { render(); } } I don't see the index page but get the offer to download a file with this content: FHcodeProtocolExceptionmessageinvalid message tagZ What is the magic here? 回答1: Try to change the HTTP port in your application.conf (default is set to 9000). 来源: https://stackoverflow.com/questions/8823743/playframework-protocolexception

Retrofit java.net.ProtocolException: Expected ':status' header not present

故事扮演 提交于 2019-12-11 02:44:55
问题 Retrofit network calls fails with a Protocol Exception suddenly in a working app. The app was working till yesterday and today all the network calls fails. The calls works fine with HTTP and with some HTTPS except my production endpoint . It seems that app is not working only on my used https endpoint but working with other https endpoint, I tried. I fixed the problem this way - OkHttpClient client = new OkHttpClient(); client.setProtocols(Arrays.asList(Protocol.HTTP_1_1)); And And my problem

Webservice returns wrong content-type response header

孤者浪人 提交于 2019-12-08 12:28:49
问题 I am trying to use third-party web service (php-based) in asp.net c# application, and failed with service configuration.Already tried add service/web reference - all the same error : The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 402 bytes of the response were: '<?xml version="1.0" encoding="utf-8"?><soap

Getting error detail from WCF REST

て烟熏妆下的殇ゞ 提交于 2019-12-06 21:51:02
问题 I have a REST service consumed by a .Net WCF client. When an error is encountered the REST service returns an HTTP 400 Bad Request with the response body containing JSON serialised details. If I execute the request using Fiddler, Javascript or directly from C# I can easily access the response body when an error occurs. However, I'm using a WCF ChannelFactory with 6 quite complex interfaces. The exception thrown by this proxy is always a ProtocolException , with no useful details. Is there any

Getting error detail from WCF REST

孤人 提交于 2019-12-05 02:01:04
I have a REST service consumed by a .Net WCF client. When an error is encountered the REST service returns an HTTP 400 Bad Request with the response body containing JSON serialised details. If I execute the request using Fiddler, Javascript or directly from C# I can easily access the response body when an error occurs. However, I'm using a WCF ChannelFactory with 6 quite complex interfaces. The exception thrown by this proxy is always a ProtocolException , with no useful details. Is there any way to get the response body when I get this error? Update I realise that there are a load of

Dealing with WCF service restart on client-side

大城市里の小女人 提交于 2019-12-03 07:50:22
问题 I've got a GUI client which is running against a WCF services hosted as a Windows service on a server box. The WCF service is running in PerCall InstanceContextMode, and the client has a singleton instance of the service client and I want to avoid reinstantiating the singleton on every call as it makes life difficult for the many asynchronous calls I have. The problem for me is, after the Windows service is restarted, everytime the client makes a call it gets an exception message like this: