博文

目前显示的是 三月, 2013的博文

Socket & SOAP

 Reading from and Writing to a Socket Ref:docs.oracle.com/javase/tutorial/networking/sockets/readingWriting.html String hostName = args[0]; int portNumber = Integer.parseInt(args[1]); try ( Socket echoSocket = new Socket(hostName, portNumber); PrintWriter out = new PrintWriter(echoSocket.getOutputStream(), true); StringBuffer soapBody = new StringBuffer(200); //create the soap request soapBody.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " +"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " +"xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<soap:Body>" + "<...>"); + "</soap:Body>" + "</soap:Envelope>"); // send an HTTP request to th