[WebService] the namespace on the "definitions" element, is not a valid SOAP version
公司对外通过webservice访问别人接口,对方webservice IP地址发生变化,切换过去之后,始终报错,在网上搜索了各种办法之后,暂时总结该问题几种可能解决办法,待真正解决时用的到。
异常详情:
org.apache.cxf.binding.soap.SoapFault: "http://schemas.xmlsoap.org/wsdl/", the namespace on the "definitions" element, is not a valid SOAP version.
javax.xml.ws.WebServiceException: org.apache.cxf.binding.soap.SoapFault: "http://schemas.xmlsoap.org/wsdl/", the namespace on the "definitions" element, is not a valid SOAP version.
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:154)
可能的几种解决办法:
1. 在编写代码时不要使用factory.create创建service,而使用cxf生成的类创建,具体如下:
// 原先在代码里使用的方法
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(IWebPService.class);
String address1 = "http://192.168.0.121:9090/cloudsun/HelloWorldService?wsdl";
factory.setAddress(address1);
IWebPService ws1 = (IWebPService) factory.create(); // 修改成以下方式初始化
URL url = new URL(address1);
IWebPService ws1 = new (url).getWebPServiceImplPort();参考:http://www.devexception.com/apache/31208.htm
2. 在调用时设置Address时,在方法1的factory.setAddress后面设置的地址,将?wsdl去掉:
例如:http://服务器IP/UA/TrustAuth?wsdl
修改为:http://服务器IP/UA/TrustAuth
总结下来,使用第1种方法修改,会一劳永逸。
另外补充其他知识:
在搜索过程中有个办法使用
new WebPServiceImplService().getWebPServiceImplPort()生成对象,经查后这个方法有两个多态方法,
public IWebPService getWebPServiceImplPort(WebServiceFeature... features)
public IWebPService getWebPServiceImplPort() {
个人理解下来前面的那个WebServiceFeature是用来改变相应的地址或其他的,可能是理解错误,然后对此做了一些深入的了解:
WebServiceFeature是一个abstract class,其有以下几个子类:
javax.xml.ws.RespectBindingFeature javax.xml.ws.soap.AddressingFeature javax.xml.ws.soap.MTOMFeature
搜了半天也没弄清楚这个类是用来干嘛的,有知道的朋友可能帮忙解答解答,以后有机会再深入研究。
参考:http://www.massapi.com/class/ad/AddressingFeature.html
[WebService] the namespace on the "definitions" element, is not a valid SOAP version的更多相关文章
- WebService发布与调用问题:expected: {http://schemas.xmlsoap.org/soap/envelope/}Envelope but found: {http://schemas.xmlsoap.org/wsdl/}definitions
Mailbox===AsYVzdwoY_b6uD s>>>>>>>javax.xml.ws.Service@103bf65 hs>>>> ...
- Property 'validate' does not exist on type 'Element | Element[] | Vue | Vue[]'. Property 'valid...
使用vue-cli 3.0+Element-ui时候,调用form表单校验时候出现的问题是: Property 'validate' does not exist on type 'Element | ...
- 【Java EE 学习 80 上】【WebService】
一.WebService概述 什么是WebService,顾名思义,就是基于Web的服务,它使用Http方式接收和响应外部系统的某种请求,从而实现远程调用.WebService实际上就是依据某些标准, ...
- 计算器之webservice实现
以下是本人原创,如若转载和使用请注明转载地址.本博客信息切勿用于商业,可以个人使用,若喜欢我的博客,请关注我,谢谢!博客地址 一.根据我的上一篇博客 MyEclipse构建Web Service(Xf ...
- WebService的简单介绍与入门使用
WebService是一个平台独立的,低耦合的,自包含的.基于可编程的web的应用程序,可使用开放的XML(标准通用标记语言下的一个子集)标准来描述.发布.发现.协调和配置这些应用程序,用于开发分布式 ...
- Java调用WebService方法总结(1)--准备工作
WebService是一种跨编程语言.跨操作系统平台的远程调用技术,已存在很多年了,很多接口也都是通过WebService方式来发布的:本系列文章主要介绍Java调用WebService的各种方法,使 ...
- spring webservice 搭建出现的异常处理。异常: NAMESPACE_ERR: An attempt is made to create or change an object in a way whi
异常:NAMESPACE_ERR: An attempt is made to create or change an object in a way whi---- 这是我自己写客户端调用webse ...
- Java之webService知识
Java之webService知识 1 webservice基础知识 1.1 webService请求的本质 一次webService本质请求,如下所示: 1.2 wsdl文档解析 wsdl文档元素结 ...
- 用Python写WebService接口并且调用
一.用ladon框架封装Python为Webservice接口 另用soaplib实现请看: http://www.jianshu.com/p/ad3c27d2a946 功能实现的同时,希望将接 ...
随机推荐
- Maven打包排除不需要的文件。
pom.xml <!-- package打包排除掉一些配置文件 --> <plugin> <groupId>org.apache.maven.plugins< ...
- How can I determine the URL that a local Git repository was originally cloned from?
git remote show origin from: http://stackoverflow.com/questions/4089430/how-can-i-determine-the-url- ...
- Angularjs与bootstrap.datetimepicker结合实现日期选择器
http://www.lovelucy.info/angularjs-best-practices.html http://damoqiongqiu.iteye.com/blog/1917971 ht ...
- 【leetcode】Text Justification
Text Justification Given an array of words and a length L, format the text such that each line has e ...
- springMVC 访问404
问题:404 但是其他的controller可以访问!!!
- MySQL字符集转换引发插入乱码问题
根据http://www.cnblogs.com/cchust/p/4601536.html进行验证测试 问题背景 在mysql上面执行一条普通的insert语句,结果报错: Incorrect st ...
- ajax与后台交互传输数据的工具类
public class Result<T> implements Serializable { private static final long serialVersionUID = ...
- python2.79安装
从官网下载最新的安装程序,基于windows的,也可以直接百度下载 点击安装,如果其他用户不需要python的话,可以使用第二个,不过我们一般都是单用户,所以没差 选择安装路径,可按默认路径安装,也可 ...
- Mathematics:Find a multiple(POJ 2356)
找组合 题目大意:给你N个自然数,请你求出若干个数的组合的和为N的整数倍的数 经典鸽巢原理题目,鸽巢原理的意思是,有N个物品,放在N-1个集合中,则一定存在一个集合有2个元素或以上. 这一题是说有找出 ...
- bat批处理设置Java JDK系统环境变量文件
自己修改第3行的Java安装目录就可以设置JAVA_HOME, classPath,追加到PATH的最前面 JAVA_HOME=C:\Program Files\Java\jdk1.6.0_10 cl ...