SOAP1.1 and SOAP1.2
在用cxf 做webservice客户端的时候碰到的:
javax.xml.ws.soap.SOAPFaultException: A SOAP 1.2 message is not valid when sent to a SOAP 1.1 only endpoint.
在网上上找了一些资料但是还是不能解决我的问题,但是还是要感谢下, 不然太不厚道了
- if (soapVersion == Soap12.getInstance()
 - && version == Soap11.getInstance()) {
 - throw new SoapFault(new Message("INVALID_11_VERSION", LOG, ns, xmlReader.getLocalName()),
 - Soap11.getInstance().getVersionMismatch());
 - }
 
- <?xml version="1.0" encoding="UTF-8"?>
 - <beans xmlns="http://www.springframework.org/schema/beans"
 - xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 - xsi:schemaLocation="
 - http://www.springframework.org/schema/beans
 - http://www.springframework.org/schema/beans/spring-beans.xsd
 - http://cxf.apache.org/jaxws
 - http://cxf.apache.org/schemas/jaxws.xsd">
 - <bean id="jaxWsProxyFatory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
 - <property name="bindingId" value="http://www.w3.org/2003/05/soap/bindings/HTTP/" />
 - <property name="serviceClass" value="net.carefx.cds.v1.services.core.CdsCoreServices" />
 - <property name="address" value="http://localhost:8181/cxf/coreServices" />
 - </bean>
 - <bean id="soapSerivces" class="net.carefx.cds.testtool.proxy.SoapServices">
 - <property name="factory" ref="jaxWsProxyFatory" />
 - </bean>
 - </beans>
 
- <span style="font-weight: normal;">
 - public class SoapServices
 - {
 - private static final Logger logger = new Logger (SoapServices.class.getName ());
 - private JaxWsProxyFactoryBean m_factory;
 - private CdsCoreServices cdsCoreServices;
 - public JaxWsProxyFactoryBean getFactory ()
 - {
 - return m_factory;
 - }
 - public void setFactory (JaxWsProxyFactoryBean factory)
 - {
 - m_factory = factory;
 - }
 - public CdsCoreServices getCdsCoreServices ()
 - {
 - if (cdsCoreServices == null)
 - {
 - cdsCoreServices = (CdsCoreServices) m_factory.create ();
 - }
 - return cdsCoreServices;
 - }
 - }</span>
 
C# java JAX-WS 问题
webservices 是java写的,用 JDK自带的EndPoint发布,客户端是用C#调用,
在服务器端抛出异常,尽管执行是正常的。
Unsupported Content-Type: application/soap+xml;charset=UTF-8 Supported ones are: [text/xml]
请问这是什么问题? 怎么解决呢? Google 了半天也没找到答案
----------------------
经试验,是C#生成客户端的过程中抛出的,用wsimport 没问题。 是soap版本的问题?
这个问题是解决了, 确实版本问题, jdk6默认是soap1.1
增加 @BindingType("http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/")
高亮的地址真是难找,SOAPBinding 里面定义的是 http://www.w3.org/2003/05/soap/bindings/HTTP/, 但不能用,提示找不到
communication, my WSDL and here is also my sun-jaxws.xml:
<?xml
version="1.0" encoding="UTF-8"?>
<endpoints version="2.0" xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime">
<endpoint
name="FormDataService"
implementation="de.bolsys.netcon.gatewaydb.wsdl.DefaultFormDataService"
wsdl="WEB-INF/wsdl/netgateway.wsdl"
binding="http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/"
url-pattern="/FormDataService" 
  enable-mtom="true"/>
</endpoints>
My service annotations: 
@WebService(name = 
"formDataPortType", targetNamespace = "http://bolsys.de/netcon/gatewaydb/wsdl")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@BindingType(value=javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_MTOM_BINDING)
@XmlSeeAlso({ 
    ObjectFactory.class 
})
My client 
annotations: 
@WebServiceClient(name = "FormDataService", targetNamespace = 
"http://bolsys.de/netcon/gatewaydb/wsdl")
Did I 
forget anything? 
[Message sent by forum member 'radovana' (radovana)] 
It 
is because your wsdl using soap11 binding, you can either change the binding to 
soap12 
like this " xmlns:soapbind="http://schemas.xmlsoap.org/wsdl/soap12/"
or simply 
remove binding="http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/" 
from your deploy descriptor 
SOAP1.1 and SOAP1.2的更多相关文章
- axis2设置soap1.1或soap1.2协议
		
现在Axis.Axis2都是同时支持SOAP1.1和SOAP1.2的.即在服务器端发布一个WebService服务之后,客户端既可以通过SOAP1.1版本来访问服务器的服务,也可以通过SOAP1.2版 ...
 - soap1.1与soap1.2
		
1.soap1.2 如果加上jar包后,项目启动报错,有可能是jar包没起作用, 解决方法:把jar包移除,重新加入jar包 TCP/IP Monitor监测到的内容: soap1.2请求与soap1 ...
 - 用java实现简单快速的webservice客户端/数据采集器(支持soap1.1和soap1.2标准,支持utf-8编码)
		
前言: 用了cxf,axis等各种wbeservice实现库,简单试用了一下动态调用的方式,很不满意,完全无法满足业务的需要,所以自己实现了一个webservice采集客户端,方便动态调用外部webs ...
 - SOAP1.1 VS SOAP1.2
		
SOAP提升: 目前WebService的协议主要有SOAP1.1和1.2.两者的命名空间不同. 见下页对比 SOAP1.1版本与SOAP1.2版本在头信息上存在差异.SOAP1.1存在SOAPAct ...
 - soap1.1与soap1.2区别
 - WebService:设置服务器提供SOAP1.2的服务
		
1,访问通过cxf发布的服务 (1)与之前一样,同样可以通过在本地通过wsdl文件和命令行生成Java文件来访问服务. 但是我们既然使用了cxf发布,就要通过cxf的工具生成访问.可以通过cxf目录的 ...
 - CXF支持 SOAP1.1 SOAP1.2协议
		
SOAP协议分为两个版本 1.1 1.2 默认支持1.1 实现方式: 1.编写接口 import javax.jws.WebService; @WebService public inte ...
 - webservice初识,SOAP1.1版本
		
客户端与服务端模式,非web端发布 1.1 [Jax-ws第一个例子] 1.1.1 第一步:服务端开发 编写SEI(Service Endpoint Interface),SEI在w ...
 - cxf ServerFactoryBean 生成基于soap1.2的WebServices
		
//获得服务工厂bean ServerFactoryBean bean = new ServerFactoryBean(); HTTPTransportFactory httpTransportFac ...
 
随机推荐
- jsp+mysql的字符过滤器
			
jsp+mysql项目里面,在和数据库交互的时候,总是出现乱码.这都是老生常谈的事情了. 之前在那里放了一放,今天觉得还是尽早解决.用了一个过滤器. 代码: package wang.util; im ...
 - 使用python登录CNZZ访问量统计网站,然后获取相应的数据
			
思路: 第一步:使用pypeteer.launcher打开浏览器, 第二步:向CNZZ的登录(通过使用iframe嵌入的阿里巴巴单点登录页面),向iframe页面中自动输入用户名和密码,然后点击登录按 ...
 - C++(指针和高级指针)-上篇
			
[在指针中存储地址] int *pAge=nullptr; //将PAge声明为int指针,即用于存储int变量的地址 如果将指针初始化为0或者NUll,以后必须将变量的地址赋给它,如下例代码: ; ...
 - Sql语法高级应用之一:使用sql语句如何实现不同的角色看到不同的数据
			
前言 在常见的管理系统中,通常都有这样的需求,管理员可以看到所有数据,部门可以看到本部门的数据,组长可以看到自己组的数据,组员只能看到自己相关的数据. 一般人的做法是,根据不同的角色通过if...el ...
 - webapi中session为null的解决方案
			
Session webapi中session为null的解决方案 在Global.asax里添加:开启Session功能(默认是不开启) 重写init方法 public class WebApiAp ...
 - linux - 【LAMP环境配置安装注意安装步骤】 9
			
(一)安装gcc glibc-devel glibc-headers ==>依赖项 kernel-headers ==>依赖项 libgomp gcc-c++ libstdc++-deve ...
 - vue + ElementUI 关闭对话框清空验证,清除form表单
			
前面跟大家提到过 elementUI验证的问题,那么今天就来看看 点击对话框和关闭按钮 怎么清空验证,清空form表单,避免二次点击还会有 验证错误的提示 1.首先在你的对话框 取消按钮 加一个cli ...
 - 4. C++11非受限联合体
			
在C/C++中,联合体是一种构造类型的数据结构.在一个联合体内,我们可以定义多种不同的数据类型,这些数据类型共享相同的内存空间,可以达到节省内存空间的目的. 1. 取消数据类型的限制 在C++98中, ...
 - vue进行路由拼图的使用案例
			
实现思路,利用路由进行实现多个组件拼图: Detail.vue <template> <div> <h1>详细展示</h1> <div>鞍山 ...
 - Vue 不睡觉教程3 - 来点实在的:自动计算剩余时间的任务列表
			
目标前两课教的是入门和文件结构.都没有什么实在的东西.这次我们要来点实在的.我们要做出一个待办列表.这个待办列表有以下特点: 可以自动从文本中抽取出这件事情的开始时间可以显示当前距离这件事情的开始时间 ...