怎样做才能在同一个Web容器内同时发布和消费webservice呢?(CXF)

大家好,第一次提问:
利用CXF发布Webservice没有问题,同样只是接受webservice服务也没有问题。但是我这里,只要把他们两个的xml文件配置同时放在web容器内,就报空指针异常,请哪位大哥指点一下:

1、client的配置文件:


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/simple http://cxf.apache.org/schemas/simple.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-2.5.xsd
http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"
default-lazy-init="true" default-autowire="byName">


id="commodityServiceClient" serviceClass="com.XXX.XXX"
address="${webservice.client.host}/XXXervice">

mtomEnabled="true" version="1.2" />









2. server的配置文件:


xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:soap="http://cxf.apache.org/bindings/soap" xmlns:simple="http://cxf.apache.org/simple"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/simple http://cxf.apache.org/schemas/simple.xsd
http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"
default-lazy-init="false" default-autowire="byName">

















3. 报出的异常是:
java.lang.NullPointerException
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoi
ntInfo(AbstractWSDLBasedEndpointFactory.java:160)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoi
nt(AbstractWSDLBasedEndpointFactory.java:102)
at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.ja
va:51)
at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFact
oryBean.java:97)
at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBe
an.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy
.instantiate(SimpleInstantiationStrategy.java:115)

你可能感兴趣的:(怎样做才能在同一个Web容器内同时发布和消费webservice呢?(CXF))