web service-Cannot create a secure XMLInputFactory

问题描述

Cannot create a secure XMLInputFactory

public static String postData1(String urlAddress, String encodedType,Map params) {

try {

URL url = new URL(urlAddress);

URLConnection conn = url.openConnection();
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "Keep-Alive");
conn.setRequestProperty("user-agent",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");

        conn.setDoOutput(true);
        conn.setDoInput(true);
        conn.setUseCaches(false); // Post请求不用设置缓存  

        conn.getOutputStream();

        // 获取返回数据
        BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
        String line = null;
        StringBuffer sb = new StringBuffer();
        while ((line = in.readLine()) != null) {
            sb.append(line);
        }
        in.close(); // 关闭流
        return sb.toString();
    } catch (Exception e) {
        e.printStackTrace();
    }
    return "";
}
    使用上述的代码访问webservice,如果不加conn.getOutputStream(),返回soap协议正确,如果加上这一句,报错500,服务器那边显示错误:不能创建一个安全的xmlInputFactory:java.lang.RuntimeException: Cannot create a secure XMLInputFactory。
    这是什么原因呢?在线等待,大家帮帮忙......

解决方案

http://blog.csdn.net/fengcheqidong/article/details/40423517
终于解决了!!!

解决方案二:

BI Java 补丁错误处理 :Cannot login to the SAP J2EE Engine using user and password as provided in the Filesystem Secure Store. Enter va
Cannot create PoolableConnectionFactory
AnyConnect cannot confirm it is connected to your secure gateway.

时间: 2024-08-01 14:42:12

web service-Cannot create a secure XMLInputFactory的相关文章

求帮助, cxfwebservice安全认证异常, Cannot create a secure XMLInputFactory

问题描述 woodstox-core-asl-4.2.0.jar包有,stax2-api-3.1.4.jar也有,cxf-2.7.12.jar包等debug跟踪了代码,客户端调用的接口,服务器也响应了,安全认证中这段SOAPMessagemess=message.getContent(SOAPMessage.class);if(mess==null){saaIn.handleFault(message);mess=message.getContent(SOAPMessage.class);}me

在Web Service中实现Transaction

web 在Web Service中实现Transaction.Net Framework为类,WebForm和WebService提供了事务处理功能.在传统的windows应用程序中,要写一个有事务处理功能的组件不仅要写代码而且要在组件服务中创建一个事务包.这就意味着在任何一台要处理这个事务的机器上,你都不得不打开mmc在COM+应用程序节点下创建一个新包..NET Framework使得这一切变得很简单,事实上我们不用在组件服务中作任何事,这一切都是自动完成的.对WebService来说,.N

通过压缩SOAP改善XML Web service性能

web|xml|性能|压缩 压缩文本是一个可以减少文本内容尺寸达80%的过程.这意味着存储压缩的文本将会比存储没有压缩的文本少80%的空间.也意味着在网络上传输内容需要更少的时间,对于使用文本通信的客户端服务器应用程序来说,将会表现出更高的效率,例如XML Web services. 本文的主要目的就是寻找在客户端和服务器之间使交换的数据尺寸最小化的方法.一些有经验的开发者会使用高级的技术来优化通过网络特别是互联网传送的数据,这样的做法在许多分布式系统中都存在瓶颈.解决这个问题的一个方法是获取更

构建安全的Xml Web Service系列(三)

web|xml|安全 首先介绍一下SSL, SSL 的英文全称是 "Secure Sockets Layer" ,中文名为 "安全套接层协议层 ",它是网景( Netscape )公司提出的基于 WEB 应用的安全协议.SSL协议可分为两层: SSL记录协议(SSL Record Protocol):它建立在可靠的传输协议(如TCP)之上,为高层协议提供数据封装.压缩.加密等基本功能的支持.SSL是Security Socket Layer的缩写,技术上称为安全套接

HOW TO: BETA: Integrate a .NET Client with an Apache SOAP 2.2 XML Web Service

apache|client|web|xml HOW TO: BETA: Integrate a .NET Client with an Apache SOAP 2.2 XML Web Service --------------------------------------------------------------------------------The information in this article applies to: Microsoft Visual Studio .N

Developing An Image Upload Web Service

web Developing An Image Upload Web Service By: Bipin JoshiLevel: IntermediatePosted Date: 5/31/2002Tested with ASP.NET v1.0 (RTM) Click for Printable Version Click here to download sample code Member Rating: 3.90 (Rated by 10 members) Rate This Item

在Pocket PC中使用Web Service连接数据库

web|连接数据库 在Pocket PC中使用Web Service连接数据库前言微软的移动开发者大会在六月的北京举行了,国内的移动应用软件虽然是刚刚起步,但是这个前景宽广的领域已经受到越来越多软件厂商的关注了.移动设备上的商业应用尽管刚刚起步,但已经显示出巨大的发展潜力. 在微软移动开发挑战赛中,我的作品<饕餮元年无线餐饮管理系统>获得了商业应用的三等奖.为了实现Pocket PC与后台数据库服务器的连接,我的作品中使用了.Net CompactFramework和Web Service技术

Web service in DW.mx

web Consuming Web Services in ASP.Net Web services have quickly become the most touted industry buzzword.  The fact that they are based on XML and other "Internet" standards make it the ideal vehicle to send and recieve information between appli

Using ASP.NET Session State in a Web Service

asp.net|session|web Quick Overview of ASP.NET SessionsASP.NET session state is maintained by using one of two underlying mechanisms. The first is by using HTTP cookies. The idea behind HTTP cookies is that when the client sends a request, the server