惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
SegmentFault 最新的问题
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Attack and Defense Labs
Attack and Defense Labs
F
Full Disclosure
Vercel News
Vercel News
N
News | PayPal Newsroom
The GitHub Blog
The GitHub Blog
H
Hacker News: Front Page
H
Heimdal Security Blog
P
Privacy International News Feed
博客园 - 司徒正美
Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cisco Blogs
L
Lohrmann on Cybersecurity
D
Docker
Recent Announcements
Recent Announcements
Security Archives - TechRepublic
Security Archives - TechRepublic
人人都是产品经理
人人都是产品经理
C
CXSECURITY Database RSS Feed - CXSecurity.com
P
Proofpoint News Feed
T
Tailwind CSS Blog
C
Check Point Blog
博客园 - 叶小钗
Google Online Security Blog
Google Online Security Blog
Martin Fowler
Martin Fowler
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
S
Secure Thoughts
博客园 - Franky
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
P
Palo Alto Networks Blog
Latest news
Latest news
量子位
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 三生石上(FineUI控件)
The Cloudflare Blog
Last Week in AI
Last Week in AI
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Cyberwarzone
Cyberwarzone
小众软件
小众软件
Cisco Talos Blog
Cisco Talos Blog
Hacker News: Ask HN
Hacker News: Ask HN
T
Threatpost
T
Tenable Blog
P
Privacy & Cybersecurity Law Blog
WordPress大学
WordPress大学

博客园 - 阿拉伯顶峰

网页兼容调试笔记 NSoup解析处理Html jeasyui控件事件和方法的使用方法 JavaScriptSerializer 序列号datatime时少了8小时 正则表达式一 jeasyui-datagrid使用笔记 javascript笔记 excel拼接函数 2014年最简单、快捷的美股Scottrade开户攻略 将ppt转换成PDF chrome开发配置(四)生成项目及配置库引用 chrome开发配置(三)安装开发工具 chrome开发配置(二)获取源代码 chrome开发配置(一)安装配置工具 ie6 js报错unterminated string constant 关于请求添加HttpRequestHeader SqlServer数据库正在还原的解决办法 dwz ie10一直提示数据加载中 Windows Server 2008下IIS 7配置ASP+ACCESS环境
wso2 data services返回json数据方法
阿拉伯顶峰 · 2013-10-19 · via 博客园 - 阿拉伯顶峰

一、首先要修改下配置文件。

修改\repository\conf\axis2目录下axis2.xml与axis2_client.xml配置文件。

增加<parameter name="httpContentNegotiation">true</parameter>配置

axis2.xml代码段如下:

    <!-- ================================================= -->
    <!-- Parameters -->
    <!-- ================================================= -->
    <parameter name="hotdeployment">true</parameter>
    <parameter name="hotupdate">true</parameter>
    <parameter name="enableMTOM" locked="false">optional</parameter>
    <parameter name="cacheAttachments">true</parameter>
    <parameter name="attachmentDIR">work/mtom</parameter>
    <parameter name="sizeThreshold">4000</parameter>
    <parameter name="httpContentNegotiation">true</parameter>
    <parameter name="EnableChildFirstClassLoading">${childfirstCL}</parameter>

axis2_client.xml代码段如下:

    <!--If turned on with use the Accept header of the request to determine the contentType of the
    response-->
    <parameter name="httpContentNegotiation">true</parameter>


二、访问服务

            WebClient w = new WebClient();
            w.Headers.Add(HttpRequestHeader.Accept, "application/json");           
            using (StreamReader sr = new StreamReader(w.OpenRead("http://192.168.1.123:9763/services/ccjy.HTTPEndpoint/getrestnews?num=4")))
            {                
                string a =sr.ReadToEnd();                
            }