[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 功能实现的同时,希望将接 ...
随机推荐
- mongoengine
http://docs.mongodb.org/ecosystem/drivers/python/ http://www.cnblogs.com/holbrook/archive/2012/03/11 ...
- selenium源码分析-webdriver(二)
最近比较空闲就仔细看了一下Selenium的源码,因为主要是使用WebDriver所以重点关注了一下WebDriver的工作原理.在前一篇blog里已经解释过了WebDriver与之前Selenium ...
- 深入理解 Win32 PE 文件格式
深入理解 Win32 PE 文件格式 Matt Pietrek 这篇文章假定你熟悉C++和Win32. 概述 理解可移植可执行文件格式(PE)可以更好地了解操作系统.如果你知道DLL和EXE中都有些什 ...
- Light OJ 1140
数位dp,需要记录前导0. 数位dp中需要注意统计0,00,000……这些数字. 数位dp的写法可以分为两类.由于我们通常采用记忆化搜索的方式进行dp,所以我们有一个记忆化数组. 一种是记忆化数组的意 ...
- iOS CoreData relationship 中的inverse
官方文档建议为每一个可以设置inverse的relationship设置一个inverse.目的是保持数据库的正确性.但是没有具体的说明. 我在stackoverflow中找到了一个是分好的答案,ht ...
- OGNL表达式
一.什么是OGNL,有什么特点? OGNL(Object-Graph Navigation Language),大概可以理解为:对象图形化导航语言.是一种可以方便地操作对象属性的开源表达式语言 ...
- 请确认 <Import> 声明中的路径正确,且磁盘上存在该文件。
在网上下了个源码打开报错. 请确认 <Import> 声明中的路径正确,且磁盘上存在该文件. 一查,原来是路径错误. 解决办法:将项目文件(.csproj)用记事本打开,然后找到<I ...
- Effective C++ -----条款36:绝不重新定义继承而来的non-virtual函数
绝对不要重新定义继承而来的non-virtual函数.
- 【leetcode】Remove Duplicates from Sorted Array I & II(middle)
Given a sorted array, remove the duplicates in place such that each element appear only once and ret ...
- 【DPM】Deformable Part Models matlab代码在windows下的调试过程
我下载的是voc-release5 1.按照这篇文章,都操作了一遍:http://blog.csdn.net/pozen/article/details/7023742#quote 2.运行demo不 ...