[WARNING] Ignoring SOAP port "HelloServicePort": it uses non-standard SOAP 1.2 b

D:\>wsimport -s . http://localhost:8080/CXF_3/cxf/hello?wsdl
parsing WSDL...


[WARNING] Ignoring SOAP port "HelloServicePort": it uses non-standard SOAP 1.2 b
inding.
You must specify the "-extension" option to use this binding.
  line 47 of http://localhost:8080/CXF_3/cxf/hello?wsdl

[WARNING] Service "HelloServiceService" does not contain any usable ports. try r
unning wsimport with -extension switch.
  line 46 of http://localhost:8080/CXF_3/cxf/hello?wsdl

generating code...


compiling code...
-----------------------------------------以下是服务代码-------------------------------------

cxf-servlet.xml:

 

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
	xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:cxf="http://cxf.apache.org/core"
	xsi:schemaLocation="http://www.springframework.org/schema/beans 
          	http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
            http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
            http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd">
	<!-- 引入CXF Bean定义如下,早期的版本中使用 -->
	<import resource="classpath:META-INF/cxf/cxf.xml" />
	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
	<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
	
	<!-- 第一种发布方式:简单发布(没有接口的发布) -->
	<!-- id:唯一标示  implementor:提供服务的类 address:服务的请求url-->
	<jaxws:endpoint id="helloService" implementor="cn.itcast.cxf.HelloService" address="/hello">
		<!-- 加入请求的消息拦截器 -->
		<jaxws:inInterceptors>
			<bean class="org.apache.cxf.interceptor.LoggingInInterceptor"></bean>
		</jaxws:inInterceptors>
		<!-- 加入响应的消息拦截器 -->
		<jaxws:outInterceptors>
			<bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"></bean>
		</jaxws:outInterceptors>
	</jaxws:endpoint>

</beans>

 HelloService:

 

 

package cn.itcast.cxf;

import javax.jws.WebService;

@WebService
@BindingType(value=SOAPBinding.SOAP12HTTP_BINDING)
public class HelloService {

	public String sayHello(String name){
		System.out.println("正在调用sayHello方法");
		return "hello " + name;
	}
}

 ----------------------------以下是分析--------------------------------------------

 

将 HelloService.java的@BindingType(value=SOAPBinding.SOAP12HTTP_BINDING)注释掉就可以了.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值