当前位置: 首页 > wzjs >正文

网站seo系统怎么买域名自己做网站

网站seo系统,怎么买域名自己做网站,WordPress版块会员可见,深圳高端网站建设价格webservice调用方式: (1)http方式调用 请求头增加Content-type:text/xml 或application/soapxml SOAPAction:方法名 请求body以xml字符串传递,xml格式定义 返回以xml字符串返回,xml某个字段是一个json字符串。 入…

webservice调用方式:

(1)http方式调用

请求头增加Content-type:text/xml 或application/soap+xml

SOAPAction:方法名

请求body以xml字符串传递,xml格式定义

返回以xml字符串返回,xml某个字段是一个json字符串。

入参如下:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dhcc="http://www.dhcc.com.cn"><soapenv:Header/><soapenv:Body><dhcc:方法名><!--Optional:--><dhcc:inputJsonStream><![CDATA[
json串...
]]></dhcc:inputJsonStream></dhcc:方法名></soapenv:Body>
</soapenv:Envelope>

curl -XPOST -H 'Content-Type:text/xml' -d '<xml></xml>'  webserviceurl

 curl -X POST -H 'Content-Type:application/soap+xml' -d @test.xml  webserviceurl,其中xml文件以本地文件的方式传递

   public static String callWebService(String webserviceurl, String method, String sendMsg, String contentType) {String retStr = "";HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();CloseableHttpClient closeableHttpClient = httpClientBuilder.build();HttpPost httpPost = new HttpPost(webserviceurl);// 设置请求和传输超时时间RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(3000).setConnectTimeout(3000).build();httpPost.setConfig(requestConfig);try {httpPost.setHeader("Content-Type", contentType);httpPost.setHeader("SOAPAction", method);StringEntity data = new StringEntity(sendMsg,Charset.forName("UTF-8"));httpPost.setEntity(data);CloseableHttpResponse response = closeableHttpClient.execute(httpPost);HttpEntity httpEntity = response.getEntity();if (httpEntity != null) {retStr = EntityUtils.toString(httpEntity, "UTF-8");logger.debug("url:{} ret:{}", url, retStr);return retStr;}} catch (Exception e) {logger.error("callWebService", e);} finally {// 释放资源try {closeableHttpClient.close();} catch (IOException e) {logger.error("close", e);}}return null;}

(2)通过apache的webservice工具调用

Client client = WsClientUtil.getClient(notifyUrl);try {Object[] objects = client.invoke(method, getjson());if (objects != null) {result = (String)objects[0];log.info(result);log.info("耗时:" +(System.currentTimeMillis() - start));}} catch (Exception e) {throw new RuntimeException("WebSocket请求异常");}}
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
import org.apache.cxf.transport.http.HTTPConduit;
import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;/*** 获取Client*/
public class WsClientUtil {private static final JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();private static final Map<String, Client> clientMap = new ConcurrentHashMap(256);public static Client getClient(String wsUrl) {// 创建动态客户端
//        JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();//根据WebServices接口地址创建clientif (clientMap.get(wsUrl) == null) {synchronized (WsClientUtil.class) {if (clientMap.get(wsUrl) == null) {Client client = clientFactory.createClient(wsUrl);HTTPConduit conduit = (HTTPConduit) client.getConduit();HTTPClientPolicy policy = new HTTPClientPolicy();policy.setAllowChunking(false);// 连接服务器超时时间 3秒policy.setConnectionTimeout(5000);// 等待服务器响应超时时间 3秒// 等待服务器响应超时时间 3秒policy.setReceiveTimeout(5000);conduit.setClient(policy);clientMap.put(wsUrl, client);return client;}}}return clientMap.get(wsUrl);}
}

但今天测试时,使用curl -X POST -H 'Content-Type:application/soap+xml' -d '' 可以通,用java客户端调用就报错。。

http://www.dtcms.com/wzjs/179691.html

相关文章:

  • 贵州高端网站开发西安网络推广公司大全
  • 技术培训班seo查询是什么意思
  • 国内做家具外贸的网站百度网络营销中心官网
  • 昌吉做网站搜索引擎优化宝典
  • 阳泉网站设计品牌营销案例分析
  • 网站开发与设计总结重庆seo排名收费
  • 北京医疗网站建设公司排名百度热搜的含义
  • wordpress自媒体新闻模板搜索引擎优化seo应用
  • 烟台 o2o平台带动做网站行业今日中国新闻
  • wordpress用户发文章外贸seo软文发布平台
  • 沙井做网站公司怎么自己刷推广链接
  • 企业邮箱怎么申请入口深圳seo培训
  • 效果图制作代做网站深圳网站设计公司哪家好
  • 北京网站建设好不好天新闻网站软文平台
  • wordpress主题 qux上海好的seo公司
  • 腾宁科技做网站399元全包网站模板价格
  • 网络营销实训总结报告武汉seo托管公司
  • 那个软件可以做网站百度客服怎么转人工
  • 商业网站建设开发网络广告推广服务
  • 做网站什么分类流量多精准网站seo诊断报告
  • 怎么编辑网站后台谷歌官网下载
  • 青海营销型网站建设找客户资源的软件哪个最靠谱
  • 明起3天洛阳市开展区域核酸检测沈阳seo网站推广
  • 天元建设集团有限公司年产值广州seo网站优化培训
  • 订阅号怎么做免费的视频网站公司网站设计哪家好
  • 做贷款的网站有哪些免费建站系统官网
  • 个人怎么做一个网站关键词优化排名软件
  • 深圳市住房和建设局地址口碑seo推广公司
  • 手机抖音你做我女朋友好吗套路网站营销推广平台
  • 自己如何做网站统计阿里云域名注册