框架当然有许多好处。比如拦截消息,客户端调用不可能谁都可以吧,服务器那边肯定要过滤一下。看你包含没有所需要的‘证件’,这时候就需要用到拦截器了。cfx内置许多拦截器。比如日志记录、用框架就得用框架的方式发布,不能再用java自带的发布了。切记
上代码:
发布:
这个是定义在服务器端的拦截器,就是在消息接受和响应服务器的时候 会先触发这个
public static void main(String[] args) {
String url="http://localhost:9999/web";
// EndpointImpl endpointImpl = (EndpointImpl) Endpoint.publish(url, new WebServiceTestImpl());
/**
* 注意,一定要是JaxWsServerFactoryBean这个类,这个类是cfx的类,不能用Endpoint这个类,这个是java自带的。
* 给一个url和实体类.class 必须实体类的!!!!!!!
*
* */
JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
factory.setAddress(url);
factory.setServiceClass(WebServiceTestImpl.class);
/**
* 添加拦截器,getInInterceptors()得到拦截器集合list。然后添加的是日志in 和 日志out
*/
factory.getInInterceptors().add(new LoggingInInterceptor());
factory.getOutInterceptors().add(new LoggingOutInterceptor());
/**
* 创建服务,启动
*/
Server server = factory.create();
server.start();
System.out.println("发布webservice成功!");
}
访问服务器,服务器这边会打印日志,三个方法,三对id,分别是输入输出的xml文件。
十一月 12, 2017 12:21:28 下午 org.springframework.context.support.AbstractApplicationContext prepareRefresh
信息: Refreshing org.apache.cxf.bus.spring.BusApplicationContext@198e2867: display name [org.apache.cxf.bus.spring.BusApplicationContext@198e2867]; startup date [Sun Nov 12 12:21:28 CST 2017]; root of context hierarchy
十一月 12, 2017 12:21:28 下午 org.apache.cxf.bus.spring.BusApplicationContext getConfigResources
信息: No cxf.xml configuration file detected, relying on defaults.
十一月 12, 2017 12:21:28 下午 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition
信息: Overriding bean definition for bean 'org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder': replacing [Generic bean: class [org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/apache-maven-3.2.2/repository/org/apache/cxf/cxf-rt-transports-http/2.2.3/cxf-rt-transports-http-2.2.3.jar!/META-INF/cxf/cxf-extension-http.fixml]] with [Generic bean: class [org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/apache-maven-3.2.2/repository/org/apache/cxf/cxf-rt-transports-http/2.2.3/cxf-rt-transports-http-2.2.3.jar!/META-INF/cxf/cxf-extension-http.fixml]]
十一月 12, 2017 12:21:28 下午 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition
信息: Overriding bean definition for bean 'org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder': replacing [Generic bean: class [org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/apache-maven-3.2.2/repository/org/apache/cxf/cxf-rt-transports-http/2.2.3/cxf-rt-transports-http-2.2.3.jar!/META-INF/cxf/cxf-extension-http.fixml]] with [Generic bean: class [org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/apache-maven-3.2.2/repository/org/apache/cxf/cxf-rt-transports-http/2.2.3/cxf-rt-transports-http-2.2.3.jar!/META-INF/cxf/cxf-extension-http.fixml]]
十一月 12, 2017 12:21:28 下午 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition
信息: Overriding bean definition for bean 'org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider': replacing [Generic bean: class [org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/apache-maven-3.2.2/repository/org/apache/cxf/cxf-rt-transports-http/2.2.3/cxf-rt-transports-http-2.2.3.jar!/META-INF/cxf/cxf-extension-http.fixml]] with [Generic bean: class [org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/apache-maven-3.2.2/repository/org/apache/cxf/cxf-rt-transports-http/2.2.3/cxf-rt-transports-http-2.2.3.jar!/META-INF/cxf/cxf-extension-http.fixml]]
十一月 12, 2017 12:21:28 下午 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition
信息: Overriding bean definition for bean 'org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory': replacing [Generic bean: class [org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory]; scope=singleton; abstract=false; lazyInit=true; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/apache-maven-3.2.2/repository/org/apache/cxf/cxf-rt-transports-http/2.2.3/cxf-rt-transports-http-2.2.3.jar!/META-INF/cxf/cxf-extension-http.fixml]] with [Generic bean: class [org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory]; scope=singleton; abstract=false; lazyInit=true; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/apache-maven-3.2.2/repository/org/apache/cxf/cxf-rt-transports-http/2.2.3/cxf-rt-transports-http-2.2.3.jar!/META-INF/cxf/cxf-extension-http.fixml]]
十一月 12, 2017 12:21:28 下午 org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
信息: Bean factory for application context [org.apache.cxf.bus.spring.BusApplicationContext@198e2867]: org.springframework.beans.factory.support.DefaultListableBeanFactory@6a4f787b
十一月 12, 2017 12:21:29 下午 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@6a4f787b: defining beans [cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.jaxws.context.WebServiceContextResourceResolver,org.apache.cxf.jaxws.context.WebServiceContextImpl,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.binding.xml.XMLBindingFactory,org.apache.cxf.ws.addressing.policy.AddressingAssertionBuilder,org.apache.cxf.ws.addressing.policy.AddressingPolicyInterceptorProvider,org.apache.cxf.ws.addressing.policy.UsingAddressingAssertionBuilder,org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder,org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider,org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory,org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory]; root of factory hierarchy
十一月 12, 2017 12:21:29 下午 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
信息: Creating Service {http://ws.lzh.com/}WebServiceTestImplService from class com.lzh.ws.WebServiceTest
十一月 12, 2017 12:21:29 下午 org.apache.cxf.endpoint.ServerImpl initDestination
信息: Setting the server's publish address to be http://localhost:9999/web
十一月 12, 2017 12:21:29 下午 org.mortbay.log.Slf4jLog info
信息: Logging to org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog
十一月 12, 2017 12:21:29 下午 org.mortbay.log.Slf4jLog info
信息: jetty-6.1.19
十一月 12, 2017 12:21:29 下午 org.mortbay.log.Slf4jLog info
信息: Started SelectChannelConnector@0.0.0.0:9999
发布webservice成功!
十一月 12, 2017 12:21:34 下午 org.apache.cxf.interceptor.LoggingInInterceptor logging
信息: Inbound Message
----------------------------
ID: 1
Address: /web
Encoding: UTF-8
Content-Type: text/xml; charset=UTF-8
Headers: {SOAPAction=[""], Accept=[*/*], Cache-Control=[no-cache], User-Agent=[Apache CXF 2.2.3], Host=[localhost:9999], connection=[keep-alive], content-type=[text/xml; charset=UTF-8], Pragma=[no-cache], Content-Length=[187], Content-Type=[text/xml; charset=UTF-8]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:add xmlns:ns2="http://ws.lzh.com/"><arg0>1</arg0><arg1>2</arg1></ns2:add></soap:Body></soap:Envelope>
--------------------------------------
十一月 12, 2017 12:21:34 下午 org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
信息: Outbound Message
---------------------------
ID: 1
Encoding: UTF-8
Content-Type: text/xml
Headers: {}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:addResponse xmlns:ns2="http://ws.lzh.com/"><return>3</return></ns2:addResponse></soap:Body></soap:Envelope>
--------------------------------------
十一月 12, 2017 12:21:34 下午 org.apache.cxf.interceptor.LoggingInInterceptor logging
信息: Inbound Message
----------------------------
ID: 2
Address: /web
Encoding: UTF-8
Content-Type: text/xml; charset=UTF-8
Headers: {SOAPAction=[""], Accept=[*/*], Cache-Control=[no-cache], User-Agent=[Apache CXF 2.2.3], Host=[localhost:9999], connection=[keep-alive], content-type=[text/xml; charset=UTF-8], Pragma=[no-cache], Content-Length=[222], Content-Type=[text/xml; charset=UTF-8]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:getDogByUser xmlns:ns2="http://ws.lzh.com/"><arg0><id>1</id><name>刘中华</name></arg0></ns2:getDogByUser></soap:Body></soap:Envelope>
--------------------------------------
十一月 12, 2017 12:21:34 下午 org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
信息: Outbound Message
---------------------------
ID: 2
Encoding: UTF-8
Content-Type: text/xml
Headers: {}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:getDogByUserResponse xmlns:ns2="http://ws.lzh.com/"><return><age>12</age><id>1</id><name>小狗</name></return><return><age>22</age><id>2</id><name>大狗</name></return></ns2:getDogByUserResponse></soap:Body></soap:Envelope>
--------------------------------------
十一月 12, 2017 12:21:34 下午 org.apache.cxf.interceptor.LoggingInInterceptor logging
信息: Inbound Message
----------------------------
ID: 3
Address: /web
Encoding: UTF-8
Content-Type: text/xml; charset=UTF-8
Headers: {SOAPAction=[""], Accept=[*/*], Cache-Control=[no-cache], User-Agent=[Apache CXF 2.2.3], Host=[localhost:9999], connection=[keep-alive], content-type=[text/xml; charset=UTF-8], Pragma=[no-cache], Content-Length=[156], Content-Type=[text/xml; charset=UTF-8]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:getDogMap xmlns:ns2="http://ws.lzh.com/"/></soap:Body></soap:Envelope>
--------------------------------------
十一月 12, 2017 12:21:34 下午 org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
信息: Outbound Message
---------------------------
ID: 3
Encoding: UTF-8
Content-Type: text/xml
Headers: {}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:getDogMapResponse xmlns:ns2="http://ws.lzh.com/"><return><list><key>第 1条狗</key><value><age>22</age><id>2</id><name>大狗</name></value></list><list><key>第 0条狗</key><value><age>12</age><id>1</id><name>小狗</name></value></list></return></ns2:getDogMapResponse></soap:Body></soap:Envelope>
--------------------------------------
在客户端设置拦截器
package com.lzh.ws.client;
import java.util.List;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import com.lzh.ws.Dog;
import com.lzh.ws.Entry;
import com.lzh.ws.StringDog;
import com.lzh.ws.User;
import com.lzh.ws.WebServiceTest;
import com.lzh.ws.WebServiceTestImplService;
public class Client {
public static void main(String[] args) {
// TODO Auto-generated method stub
WebServiceTestImplService impl = new WebServiceTestImplService();
WebServiceTest implPort = impl.getWebServiceTestImplPort();
/**
* 添加日志拦截器 先创建一个代理类,是cfx的类,参数是上面的implPort(这个类是webService的远程代理),
*/
org.apache.cxf.endpoint.Client proxy = ClientProxy.getClient(implPort);
proxy.getInInterceptors().add(new LoggingInInterceptor());
proxy.getOutInterceptors().add(new LoggingOutInterceptor());
int add = implPort.add(1, 2);
System.out.println(add);
User user = new User();
user.setId(1);
user.setName("刘中华");
List<Dog> list = implPort.getDogByUser(user);
for(Dog d:list){
System.out.println(d.getName());
}
System.out.println("-------------");
StringDog dogMap = implPort.getDogMap();
for(Entry e:dogMap.getList()){
System.out.println(e.getValue().getName());
}
}
}
打印结果
十一月 12, 2017 12:58:03 下午 org.springframework.context.support.AbstractApplicationContext prepareRefresh
信息: Refreshing org.apache.cxf.bus.spring.BusApplicationContext@50134894: display name [org.apache.cxf.bus.spring.BusApplicationContext@50134894]; startup date [Sun Nov 12 12:58:03 CST 2017]; root of context hierarchy
十一月 12, 2017 12:58:03 下午 org.apache.cxf.bus.spring.BusApplicationContext getConfigResources
信息: No cxf.xml configuration file detected, relying on defaults.
十一月 12, 2017 12:58:03 下午 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition
信息: Overriding bean definition for bean 'org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder': replacing [Generic bean: class [org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/apache-maven-3.2.2/repository/org/apache/cxf/cxf-rt-transports-http/2.2.3/cxf-rt-transports-http-2.2.3.jar!/META-INF/cxf/cxf-extension-http.fixml]] with [Generic bean: class [org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/apache-maven-3.2.2/repository/org/apache/cxf/cxf-rt-transports-http/2.2.3/cxf-rt-transports-http-2.2.3.jar!/META-INF/cxf/cxf-extension-http.fixml]]
十一月 12, 2017 12:58:03 下午 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition
信息: Overriding bean definition for bean 'org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder': replacing [Generic bean: class [org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/apache-maven-3.2.2/repository/org/apache/cxf/cxf-rt-transports-http/2.2.3/cxf-rt-transports-http-2.2.3.jar!/META-INF/cxf/cxf-extension-http.fixml]] with [Generic bean: class [org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/apache-maven-3.2.2/repository/org/apache/cxf/cxf-rt-transports-http/2.2.3/cxf-rt-transports-http-2.2.3.jar!/META-INF/cxf/cxf-extension-http.fixml]]
十一月 12, 2017 12:58:03 下午 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition
信息: Overriding bean definition for bean 'org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider': replacing [Generic bean: class [org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/apache-maven-3.2.2/repository/org/apache/cxf/cxf-rt-transports-http/2.2.3/cxf-rt-transports-http-2.2.3.jar!/META-INF/cxf/cxf-extension-http.fixml]] with [Generic bean: class [org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/apache-maven-3.2.2/repository/org/apache/cxf/cxf-rt-transports-http/2.2.3/cxf-rt-transports-http-2.2.3.jar!/META-INF/cxf/cxf-extension-http.fixml]]
十一月 12, 2017 12:58:03 下午 org.springframework.beans.factory.support.DefaultListableBeanFactory registerBeanDefinition
信息: Overriding bean definition for bean 'org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory': replacing [Generic bean: class [org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory]; scope=singleton; abstract=false; lazyInit=true; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/apache-maven-3.2.2/repository/org/apache/cxf/cxf-rt-transports-http/2.2.3/cxf-rt-transports-http-2.2.3.jar!/META-INF/cxf/cxf-extension-http.fixml]] with [Generic bean: class [org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory]; scope=singleton; abstract=false; lazyInit=true; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/D:/apache-maven-3.2.2/repository/org/apache/cxf/cxf-rt-transports-http/2.2.3/cxf-rt-transports-http-2.2.3.jar!/META-INF/cxf/cxf-extension-http.fixml]]
十一月 12, 2017 12:58:03 下午 org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
信息: Bean factory for application context [org.apache.cxf.bus.spring.BusApplicationContext@50134894]: org.springframework.beans.factory.support.DefaultListableBeanFactory@5f2050f6
十一月 12, 2017 12:58:03 下午 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@5f2050f6: defining beans [cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.jaxws.context.WebServiceContextResourceResolver,org.apache.cxf.jaxws.context.WebServiceContextImpl,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.binding.xml.XMLBindingFactory,org.apache.cxf.ws.addressing.policy.AddressingAssertionBuilder,org.apache.cxf.ws.addressing.policy.AddressingPolicyInterceptorProvider,org.apache.cxf.ws.addressing.policy.UsingAddressingAssertionBuilder,org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder,org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider,org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory,org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory]; root of factory hierarchy
十一月 12, 2017 12:58:04 下午 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromWSDL
信息: Creating Service {http://ws.lzh.com/}WebServiceTestImplService from WSDL: http://localhost:9999/web?wsdl
十一月 12, 2017 12:58:04 下午 org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
信息: Outbound Message
---------------------------
ID: 1
Address: http://localhost:9999/web
Encoding: UTF-8
Content-Type: text/xml
Headers: {SOAPAction=[""], Accept=[*/*]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:add xmlns:ns2="http://ws.lzh.com/"><arg0>1</arg0><arg1>2</arg1></ns2:add></soap:Body></soap:Envelope>
--------------------------------------
十一月 12, 2017 12:58:04 下午 org.apache.cxf.interceptor.LoggingInInterceptor logging
信息: Inbound Message
----------------------------
ID: 1
Encoding: UTF-8
Content-Type: text/xml; charset=utf-8
Headers: {Server=[Jetty(6.1.19)], content-type=[text/xml; charset=utf-8], Content-Length=[193]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:addResponse xmlns:ns2="http://ws.lzh.com/"><return>3</return></ns2:addResponse></soap:Body></soap:Envelope>
--------------------------------------
3
十一月 12, 2017 12:58:04 下午 org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
信息: Outbound Message
---------------------------
ID: 2
Address: http://localhost:9999/web
Encoding: UTF-8
Content-Type: text/xml
Headers: {SOAPAction=[""], Accept=[*/*]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:getDogByUser xmlns:ns2="http://ws.lzh.com/"><arg0><id>1</id><name>刘中华</name></arg0></ns2:getDogByUser></soap:Body></soap:Envelope>
--------------------------------------
十一月 12, 2017 12:58:04 下午 org.apache.cxf.interceptor.LoggingInInterceptor logging
信息: Inbound Message
----------------------------
ID: 2
Encoding: UTF-8
Content-Type: text/xml; charset=utf-8
Headers: {Server=[Jetty(6.1.19)], content-type=[text/xml; charset=utf-8], Content-Length=[311]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:getDogByUserResponse xmlns:ns2="http://ws.lzh.com/"><return><age>12</age><id>1</id><name>小狗</name></return><return><age>22</age><id>2</id><name>大狗</name></return></ns2:getDogByUserResponse></soap:Body></soap:Envelope>
--------------------------------------
小狗
大狗
-------------
十一月 12, 2017 12:58:04 下午 org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose
信息: Outbound Message
---------------------------
ID: 3
Address: http://localhost:9999/web
Encoding: UTF-8
Content-Type: text/xml
Headers: {SOAPAction=[""], Accept=[*/*]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:getDogMap xmlns:ns2="http://ws.lzh.com/"/></soap:Body></soap:Envelope>
--------------------------------------
十一月 12, 2017 12:58:04 下午 org.apache.cxf.interceptor.LoggingInInterceptor logging
信息: Inbound Message
----------------------------
ID: 3
Encoding: UTF-8
Content-Type: text/xml; charset=utf-8
Headers: {Server=[Jetty(6.1.19)], content-type=[text/xml; charset=utf-8], Content-Length=[388]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:getDogMapResponse xmlns:ns2="http://ws.lzh.com/"><return><list><key>第 1条狗</key><value><age>22</age><id>2</id><name>大狗</name></value></list><list><key>第 0条狗</key><value><age>12</age><id>1</id><name>小狗</name></value></list></return></ns2:getDogMapResponse></soap:Body></soap:Envelope>
--------------------------------------
大狗
小狗