<wsdl:definitions xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://server.cxf.rl.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="HelloServiceService" targetNamespace="http://server.cxf.rl.com/">
<wsdl:types>
<xs:schema xmlns:tns="http://server.cxf.rl.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" targetNamespace="http://server.cxf.rl.com/" version="1.0">
<xs:element name="sayHello" type="tns:sayHello"/>
<xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
<xs:complexType name="sayHello">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="sayHelloResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="sayHello">
<wsdl:part element="tns:sayHello" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="sayHelloResponse">
<wsdl:part element="tns:sayHelloResponse" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:portType name="HelloService">
<wsdl:operation name="sayHello">
<wsdl:input message="tns:sayHello" name="sayHello"></wsdl:input>
<wsdl:output message="tns:sayHelloResponse" name="sayHelloResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="HelloServiceServiceSoapBinding" type="tns:HelloService">
<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="sayHello">
<soap12:operation soapAction="" style="document"/>
<wsdl:input name="sayHello">
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output name="sayHelloResponse">
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="HelloServiceService">
<wsdl:port binding="tns:HelloServiceServiceSoapBinding" name="HelloServicePort">
<soap12:address location="http://127.0.0.1:5555/hello"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

http://www.cnblogs.com/yanzige/p/5377332.html


package com.rl.cxf.client;

import com.rl.soap11.HelloService;
import com.rl.soap11.HelloServiceService; public class Soap11Client {
public static void main(String[] args) {
HelloServiceService hss = new HelloServiceService();
HelloService hs = hss.getHelloServicePort();
String result = hs.sayHello("lisi");
System.out.println(result); }
}
package com.rl.cxf.client;

import com.rl.cxf.server.HelloService;
import com.rl.cxf.server.HelloServiceService; public class Soap12Client {
public static void main(String[] args) {
HelloServiceService hss = new HelloServiceService();
HelloService hs = hss.getHelloServicePort();
String result = hs.sayHello("lisi");
System.out.println(result); }
}
package com.rl.cxf.server;

import javax.jws.WebService;
import javax.xml.ws.BindingType; @WebService
//@BindingType(value=javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING )
@BindingType(value=javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING )
public class HelloService {
public String sayHello(String name){
return name + " hello";
}
}
package com.rl.cxf.server;

//import org.apache.cxf.frontend.ServerFactoryBean;
import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsServerFactoryBean; public class MyCXFServer {
public static void main(String[] args) {
//创建服务工厂对象
//ServerFactoryBean sfb = new ServerFactoryBean();
JaxWsServerFactoryBean sfb = new JaxWsServerFactoryBean();
//加入输入输出拦截器
sfb.getInInterceptors().add(new LoggingInInterceptor());
//sfb.getOutFaultInterceptors().add(new LoggingOutInterceptor());
sfb.getOutInterceptors().add(new LoggingOutInterceptor());
//指定服务地址
sfb.setAddress("http://127.0.0.1:5555/hello");
//设置服务类
sfb.setServiceClass(HelloService.class);
//设置服务类的实例对象
sfb.setServiceBean(new HelloService());
//发布服务
sfb.create();
System.out.println("server ready...");
}
}

day63-webservice 04.JaxWsServerFactoryBean和SOAP1.2的更多相关文章

  1. 使用CXF开发JAX-WS类型的WebService

    使用CXF记得要先加入CXF的jar包 方法1: Cxf编程实现: l 使用jaxwsServerFactoryBean发布 webservice服务端. 需要设置: jaxwsServerFacto ...

  2. webservice的cxf和spring整合发布

    1.新建一个web项目 2.导入cxf相应的jar包,并部署到项目中 3.服务接口 package com.xiaostudy; /** * @desc 服务器接口 * @author xiaostu ...

  3. webservice用cxf发布SOAP

    cxf的安装,就是把文件解压,然后配置环境变量 http://cxf.apache.org/download.html这是官网下载 解压到这里 环境变量 wsdl2java命令测试 1.新建java项 ...

  4. Webservice与CXF框架快速入门

    1. Webservice Webservice是一套远程调用技术规范 远程调用RPC, 实现了系统与系统进程间的远程通信.java领域有很多可实现远程通讯的技术,如:RMI(Socket + 序列化 ...

  5. WebService使用介绍(三)

    jax-ws开发深入 JAX-WS注解 注解说明 WebService的注解都位于javax.jws包下: @WebService-定义服务,在public class上边 targetNamespa ...

  6. Java中的WebService服务

    一.在本地发布一个webservice服务 1.使用jdk中的 javax.xml.ws.Endpoint 类的 static Endpointpublish(Stringaddress,Object ...

  7. Java发布webservice应用并发送SOAP请求调用

    webservice框架有很多,比如axis.axis2.cxf.xFire等等,做服务端和做客户端都可行,个人感觉使用这些框架的好处是减少了对于接口信息的解析,最主要的是减少了对于传递于网络中XML ...

  8. (二)使用CXF开发WebService服务器端接口

    CXF作为java领域主流的WebService实现框架,Java程序员有必要掌握它. CXF主页:http://cxf.apache.org/ 简介:百度百科 今天的话,主要是用CXF来开发下Web ...

  9. Jmeter之WebService接口测试

    一.简介  1.JMeter3.2前的版本,可以使用SOAP/XML-RPC Request插件直接进行webservice接口,而3.2后的版本则已经取消了这个接口,需要另外的方法才能进行测试. 2 ...

随机推荐

  1. SQLite 在 Android 的应用

    Android提供了创建和使用SQLite数据库的API(Application Programming Interface,应用程序编程接口). 在Android系统中,主要由类SQLiteData ...

  2. 用js制作一个计算器

    使用js制作计算器 <!doctype html> <html lang="en"> <head> <meta charset=" ...

  3. SLAM:飞行机器人的参数解析-分类

    在水电站存在的山区,公路运输效率极低,盘山公路绕行消耗大量时间,使用飞行机器人进行运输是合适的选择. 实现一位长辈在山区飞行的愿望,任重而道远 常见飞行机器人的参数解析:解读飞行机器人的基本类型及技术 ...

  4. 使用GitGUI创建上传本地工程

    参考链接: 使用Git-GUI创建工程 http://jingyan.baidu.com/article/27fa732683ebf546f8271f2e.html 一.刚创建的github版本库,在 ...

  5. 在安卓JNI/NDK中使用C++11

    在VS下编写的程序移植到Eclipse下,出现了问题: this file requires compiler and library support for iso C++ 2011 standar ...

  6. 25-Ubuntu-文件和目录命令-其他命令-重定向

    重定向 Linux允许将命令执行结果重定向到一个文件. 将本应显示到终端上的内容输出或追加到指定文件中. 重定向命令 含义 > 表示输出,会覆盖原有文件. >> 表示追加,会将内容追 ...

  7. 用电销机器人让电销企业迈入AI智能时代

    2019年是AI智能快速发展的一年,有非常多的企业已经用AI智能代替原有的传统员工做重复性高的工作,就拿销售行业来说,为了让电销员工提升工作效率,拥有更多的成单,大部分有电销岗位的公司都会把重复率较高 ...

  8. PAT_A1154#Vertex Coloring

    Source: PAT A 1154 Vertex Coloring (25 分) Description: A proper vertex coloring is a labeling of the ...

  9. 大话数据结构pdf高清版下载

    大话数据结构PDF下载 不得不说严老师版的虽然比较经典,但是真的有点难理解啊,而大话数据结构这本书还是比较不错的,通俗易懂,反正我个人觉得很不错,希望对诸位有帮助. 链接:点击打开 密码:xovz p ...

  10. Linux之部署虚拟环境、安装系统

    本章涵盖了Linux的优势和哲学思想,零基础详细记录了部署虚拟环境安装Linux系统,完整演示了VM虚拟机的安装与配置过程,以及Centos 7系统的安装.配置过程和初始化方法. Linux优势分析: ...