client

Reaching a network device by IP and port using the Android emulator

血红的双手。 提交于 2019-12-17 18:14:52
问题 Why my java app for android not connect to server ? I run the aplication in android emulator, and the server wich port 9999 and host 127.0.0.1 in my pc, but just not connect and i think this method isn't good for android app. Update: I work with API 8 ... Android 2.2 ! It is work Good ! ! Thanks everybody ;) It is my source code: import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import

Large file transfer with sockets

一个人想着一个人 提交于 2019-12-17 17:59:37
问题 When I'm transferring a large file using socket programming, the received file is incomplete i.e. it is an mp3 file which when i play sounds weird. The code is: Server side: File myFile = new File("abc.mp3"); { Socket sock = servsock.accept(); int packetsize=1024; double nosofpackets=Math.ceil(((int) myFile.length())/packetsize); BufferedInputStream bis = new BufferedInputStream(new FileInputStream(myFile)); for(double i=0;i<nosofpackets+1;i++) { byte[] mybytearray = new byte[packetsize]; bis

WCF REST client windows authentication

↘锁芯ラ 提交于 2019-12-17 17:18:43
问题 I am following below example but getting Unauthorized 401 error on server side. https://www.dotnetcurry.com/ShowArticle.aspx?ID=434 I tried below WCF REST Service with Windows Authentication and SSL WCF Windows authentication issue with REST service This is close to mine how to consume wcf rest service with windows authentication I have IService interface like below [OperationContract] [WebInvoke( Method = "POST", UriTemplate = "/Students/getStudents", BodyStyle = WebMessageBodyStyle.Bare,

Accessing secure restful web services using jersey client

不打扰是莪最后的温柔 提交于 2019-12-17 15:38:31
问题 I have created web services based on Jersey (auto generated via Netbeans). I have also created a user names “testClient” with password “secret” and created User group “Users” and used file Realm using glassfish 3.0.1 admin console. I have also mapped web.xml and sun-web.xml accordingly. My web services are secured successfully; as I access the web site I receive a security warning and then I am prompt to give username and password to access any content of the website. It is working fine when

NoSuchMethodError: MultivaluedMap.addAll in Jersey Client

此生再无相见时 提交于 2019-12-17 12:14:32
问题 I'm trying to use Jersey Client to simulate HTTP requests to my web service. I tried to implement the simple example from the documentation. Here's my short code: public void restoreTest(String sessionId) throws Exception { Client client = ClientBuilder.newClient(); WebTarget target = client.target(idsUrl).path("restore"); Form form = new Form(); form.param("sessionId", sessionId); target.request(MediaType.APPLICATION_FORM_URLENCODED_TYPE); } I didn't even implement the whole example, because

Jersey Client API - authentication

六眼飞鱼酱① 提交于 2019-12-17 10:22:37
问题 I'm using the Jersey client API to submit SOAP requests to a JAX-WS webservice. By default Jersey is somehow using my Windows Nt credentials for authentication when challenged. Can anyone explain where Jersey does this in the code? And can it be overriden? I have tried using HTTPBasicAuthFilter and adding as a filter on the Client. I have also tried adding my credentials to the WebResoruce queryParams field however neither are being picked up. 回答1: At first I got this working as documented in

Is there a WebSocket client implemented for .NET? [closed]

倖福魔咒の 提交于 2019-12-17 10:11:44
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I would like to use WebSockets in my Windows Forms or WPF-application. Is there a .NET-control that is supporting WebSockets implemented yet? Or is there any open source project started about it? An open source solution for a Java Client supporting WebSockets could also help me. 回答1: Now, SuperWebSocket also

How to get a progress bar for a file upload with Apache HttpClient 4?

本小妞迷上赌 提交于 2019-12-17 08:30:31
问题 I've got the following code for a file upload with Apache's HTTP-Client (org.apache.http.client): public static void main(String[] args) throws Exception { String fileName = "test.avi"; File file = new File(fileName); String serverResponse = null; HttpParams params = new BasicHttpParams(); params.setParameter(HttpProtocolParams.USE_EXPECT_CONTINUE, true); HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1); HttpClient client = new DefaultHttpClient(params); HttpPut put = new HttpPut(

readobject method throws ClassNotFoundException

送分小仙女□ 提交于 2019-12-17 07:40:21
问题 I'm trying to pick up Java and wanted to test around with Java's client/server to make the client send a simple object of a self defined class(Message) over to the server. The problem was that I kept getting a ClassNotFoundException on the server side. I think the rest of the codes seem to be alright because other objects such as String can go through without problems. I had two different netbeans projects in different locations for client and server each. Each of them have their own copy of

android webview with client certificate

送分小仙女□ 提交于 2019-12-17 06:38:15
问题 I tried for days to use a web view with a client certificate embedded in the application, but it seems to me that the android sdk does not provide any way to do it, is there a callback to intercept the challenge sent by the server? is there a way to use webview with a client certificate and make https request? 回答1: Since I'm interested in your problem as well, I checked the documentation for WebView and WebViewClient, surfed around and indeed it looks that you can't authenticate a webview