httpclient for accessing webservice

Karthik Rajendiran探讨了如何利用Apache HttpClient库访问基于SOAP协议的WebService,包括构造XML请求和从响应中读取信息的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

httpclient for accessing webservice
Karthik Rajendiran 
Ranch Hand 


Joined: Aug 13, 2004
Posts: 204 
posted Sunday, August 31, 2008 22:03   
Hello Friends,


can we use httpclient by apache commons to access webservice.


How do we send the soap request to the webservice, should ihave to frame the request and post
or is it enough if i give xml of the document based webserviec alone to server.


1. How to construct the xml with parameters and how to read from the response.


Can anyone help with this?
SCJP 1.4 SCWCD 1.4 SCDJWS 1.4


William Brogden 
Author and all-around good cowpoke 
Rancher 


Joined: Mar 22, 2000
Posts: 11457 
posted Monday, September 01, 2008 08:36   
1. IF the service you need to access is based on the SOAP protocol, THEN there are numerous toolkits which will help you create a client that can create a SOAP formated request and interpret the response. The Apache Axis2 toolkit is one example. 


2. HttpClient makes it easy to use sevices based on RESTful designs for creating a request. The standard Java library (java.net package) can also be used. You will have to code the response interpretation.


3. For simple SOAP queries where you have an example SOAP message provided by the service, you can use HttpClient or the standard Java library to generate a request using the example as a template. Again - interpreting the response will require custom code.


Bill
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值