package liu;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
public class YongYou2 {
public static void main(String[] args) {
int TIME_OUT = 30000;//半分钟超时
int responseCode = 0;
try
{
String url="http://10.9.20.24/FromNC_SKXXHC/BTSHTTPReceive.dll";
URL postUrl = new URL(url);
HttpURLConnection connection = (HttpURLConnection)postUrl.openConnection();
connection.setConnectTimeout(TIME_OUT);
connection.setReadTimeout(TIME_OUT);
connection.setDoOutput(true);
connection.setRequestMethod("POST");
connection.setUseCaches(false);
connection.setInstanceFollowRedirects(true);
connection.setRequestProperty("Content-Type","text/xml");
connection.connect();
/*
//将Document对象写入连接的输出流中
BufferedOutputStream out = new BufferedOutputStream(connection.getOutputStream());
File file = new File("F:\\FromNC.txt");
InputStream input = new FileInputStream(file);
byte[] by = new byte[1024*1024];
int i=0;
while((i=input.read(by))!=-1) {
out.write(by, 0, i);
}
*/
FileInputStream fis = null;
BufferedOutputStream out = new BufferedOutputStream(connection.getOutputStream());
fis = new FileInputStream(new File("f:\\FromNC.txt"));
byte[] buffer = new byte[fis.available()];
fis.read(buffer);
String str = new String(buffer, "GBK");
out.write(str.getBytes("utf-8"));
//out.writeChars(content);
out.flush();
out.close();
responseCode = connection.getResponseCode();
connection.disconnect();
System.out.println("HttpStatusCode="+responseCode);
if (responseCode == 202 || responseCode==200)
System.out.println("发送成功");
else
System.out.println("发送失败");
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
分享到:
相关推荐
相对的,XML则没有固定的标记,XML不能描述网页具体的外观,内容,它只是描述内容的数据形式和结构。 这是一个质的区别:网页将数据和显示混在一起,而XML则将数据和显示分开来。 我们看上面的例子,在myfile.htm...
BizTalk Server 2006 adds incremental value to BizTalk 2004 by improving administration, deployment, and other key areas of the product. BizTalk 2006 Recipes: A Problem-Solution Approach is based on ...
BizTalk Server 2006 adds incremental value to BizTalk 2004 by improving administration, deployment, and other key areas of the product. BizTalk 2006 Recipes: A Problem-Solution Approach is based on ...
搞懂XML,看清SOAP,攻占BizTalk 搞懂XML,看清SOAP,攻占BizTalk 搞懂XML,看清SOAP,攻占BizTalk
搞懂 XML、SOAP、BizTalk(PDF)简介 搞懂XML,看清SOAP,攻占BizTalk
搞懂XML、SOAP、BizTalk
Microsoft Biztalk 学习 70-595 考证 必备 电子书 E book 包含随书代码
Installing BizTalk Server 2010 and BAM in a Multi-Computer Environment
BizTalk Server 2006 Installation Guide - Windows XP
Biztalk Server 2004 介绍-20050412.doc is a book that introduce the Biztalk of microsoft
The centerpiece of Microsoft's .NET initiative, BizTalk Server 2000 aims to solve one of the perennial bugbears of the corporate programmer. By the judicious application of XML messaging (under the ...
Microsoft BizTalk Server 2010 (70-595) Certification Guide
4.2.2 将信息模型映射到XML 4.3 模式语言和表示法 4.3.1 模式的作用 4.3.2 将DTD作为模式 4.3.3 XML模式建议 4.4 小结 第5章 文档对象模型 5.1 什么是文档对象模型 5.1.1 XML文档结构 5.1.2 为何使用DOM ...
XML简介/CSS样式语言/BIZTALK框架/综合应用...
搞懂XML,看清SOAP攻占BizTalk
BizTalk2013Recipes2ndEditionFreePDFBooks-英文原版.zip
BizTalk开发系列(1-40).docxBizTalk开发系列(1-40).docxBizTalk开发系列(1-40).docxBizTalk开发系列(1-40).docxBizTalk开发系列(1-40).docxBizTalk开发系列(1-40).docxBizTalk开发系列(1-40).docxBizTalk开发系列(1-...
基于BizTalk的异构系统集成实现,凌咏红,杨维,本文介绍了Biztalk的基本概念,将Biztalk数据交换技术应用于电子政务平台的集成,从而解决了目前电子政务中的”信息孤岛”现象,并以硚口�
该系统能够读取系统的日志,读取Biztalk中的日志信息