CXF3.0.2+Spring3.2.14 WebService入门实例三

好了,继续学习CXF WebService!这次学习CXF拦截器,老天开眼了,比较顺利,各位大牛,大神请飘过!不要嘲笑我等小白,不对我是老白了,因为我们不在一个频道上!首先还是要介绍一下开发工具和开发环境,jdk1.6.0_43+Tomcat6.0.29+MyEclipse10.5,没有使用Maven进行管理!

 

一、新建web工程,不要选择Java EE6.0,如果选了,会报一个错误!下面将会有介绍。


二、新建接口HelloWorld.java

package com.firstws.test;

 

import javax.jws.WebService;

 

@WebService

public interface HelloWorld{

    public String sayHi(String name);

}

三、新建HelloWorldImpl.java

package com.firstws.test;

 

import javax.jws.WebService;

 

@WebService(endpointInterface = "com.firstws.test.HelloWorld")

public class HelloWorldImpl implements HelloWorld {

    //注意此处不能写@Override,好像是jdk1.5不支持

    public String sayHi(String text) {

        System.out.println("sayHi方法被调用!");

        return "Hello " + text;

    }

 

}

四、建立服务类Server.java

package com.firstws.test;

 

import javax.xml.ws.Endpoint;

 

public class Server {

 

    protected Server() throws Exception {

        System.out.println("Starting Server");

        HelloWorldImpl implementor = new HelloWorldImpl();

        String address = "http://localhost:8080/wbInter";

        Endpoint.publish(address,implementor);

    }

 

    public static void main(String args[]) throws Exception {

        new Server();

        System.out.println("Server ready...");

 

        Thread.sleep(5 * 60 * 1000);

        System.out.println("Server exiting");

       System.exit(0);

    }

}

五、点击运行Server.java,如果新建web工程,你选择的是Java EE5.0,那么控制台将出现如下信息

Starting Server

2016-1-6 9:34:47org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBeanbuildServiceFromClass...

Server ready...

=====================================================================

如果你新建web工程是你选择的是Java EE6.0,那么控制台将报如下异常!然后网上一搜好多解决方式,巴拉巴拉,心中一万头草你妈飘过~~~,最后发现是工程中的jdk问题~~~~

Starting Server

2016-1-6 9:37:10 ...

Exception in thread"main" java.lang.NoSuchMethodError:org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V

    atorg.eclipse.jetty.util.log.JettyAwareLogger.log(JettyAwareLogger.java:607)

    atorg.eclipse.jetty.util.log.JettyAwareLogger.warn(JettyAwareLogger.java:431)

    atorg.eclipse.jetty.util.log.Slf4jLog.warn(Slf4jLog.java:69)

    atorg.eclipse.jetty.util.component.AbstractLifeCycle.setFailed(AbstractLifeCycle.java:204)

    atorg.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:74)

    atorg.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:417)

    atorg.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:179)

    atorg.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:53)

    atorg.apache.cxf.binding.AbstractBindingFactory.addListener(AbstractBindingFactory.java:95)

    atorg.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBindingFactory.java:895)

    atorg.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:123)

    atorg.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:362)

    atorg.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:251)

    atorg.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:155)

    atjavax.xml.ws.Endpoint.publish(Endpoint.java:57)

    atcom.firstws.test.Server.<init>(Server.java:11)

    atcom.firstws.test.Server.main(Server.java:15)

 

 

六、建立一个拦截器测试类InterceperTest.java

package com.firstws.interceptor;

 

importorg.apache.cxf.interceptor.LoggingInInterceptor;

importorg.apache.cxf.interceptor.LoggingOutInterceptor;

importorg.apache.cxf.jaxws.JaxWsProxyFactoryBean;

 

import com.firstws.test.HelloWorld;

 

public class InterceperTest {

   

    publicstatic void main(String[] args) {

       JaxWsProxyFactoryBeanfactory = new JaxWsProxyFactoryBean();

       factory.setServiceClass(HelloWorld.class);

       factory.setAddress("http://localhost:8080/wbInter/HelloWorld");

       factory.getInInterceptors().add(newLoggingInInterceptor());

       factory.getOutInterceptors().add(newLoggingOutInterceptor());

      

       HelloWorldhw = (HelloWorld) factory.create();      

       Stringresult = hw.sayHi("abc");

       System.out.println("haaha=="+result);

    }

 

}

七、点击运行InterceperTest.java

信息: Outbound Message

---------------------------

ID: 1

Address:http://localhost:8080/wb2/HelloWorld

Encoding: UTF-8

Http-Method: POST

Content-Type: text/xml

Headers: {Accept=[*/*],SOAPAction=[""]}

Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:sayHixmlns:ns2="http://test.firstws.com/"><arg0>abc</arg0></ns2:sayHi></soap:Body></soap:Envelope>

--------------------------------------

2016-1-6 9:41:18org.apache.cxf.services.HelloWorldService.HelloWorldPort.HelloWorld

信息: Inbound Message

----------------------------

ID: 1

Response-Code: 200

Encoding: UTF-8

Content-Type:text/xml;charset=UTF-8

Headers: {Content-Length=[211],content-type=[text/xml;charset=UTF-8], Server=[Jetty(8.1.15.v20140411)]}

Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:sayHiResponsexmlns:ns2="http://test.firstws.com/"><return>Helloabc</return></ns2:sayHiResponse></soap:Body></soap:Envelope>

--------------------------------------

haaha==Hello abc

 

 

八、有些时候我们需要自定义一个拦截器,做一些特殊的处理!新建一个实现类

MessageInterceptor.java

 

package com.firstws.interceptor;

 

importorg.apache.cxf.interceptor.Fault;

 

importorg.apache.cxf.message.Message;

importorg.apache.cxf.phase.AbstractPhaseInterceptor;

 

/**

 * 功能:自定义消息拦截器 

 * 作者:张述飞

 * 创建日期:2015-12-31 9:55

 * qq:361202421

 * 版本:V1.0

 */

 

 

Public class MessageInterceptorextends AbstractPhaseInterceptor<Message> {

 

    publicMessageInterceptor(String phase) {

       super(phase);

    }

 

    publicvoid handleMessage(Message message) throws Fault {

       System.out.println("###########handlerMessage############");

       System.out.println(message);

       if(message.getDestination() != null) {

           System.out.println(message.getId()+ "##" +message.getDestination().getMessageObserver());

       }

      

       if(message.getExchange() != null) {

           System.out.println(message.getExchange().getInMessage()+ "##" +message.getExchange().getInFaultMessage());

           System.out.println(message.getExchange().getOutMessage()+ "##" +message.getExchange().getOutFaultMessage());

       }

    }

 

}

 

九、新建发布类DeployInteceptorClient.java

package com.firstws.interceptor;

 

importorg.apache.cxf.jaxws.JaxWsServerFactoryBean;

importorg.apache.cxf.phase.Phase;

 

importcom.firstws.test.HelloWorld;

importcom.firstws.test.HelloWorldImpl;

 

public class DeployInteceptorClient{

 

    publicstatic void main(String[] args) throws Exception {

      

       JaxWsServerFactoryBeanfactory = new JaxWsServerFactoryBean();

       factory.setServiceClass(HelloWorld.class);

       factory.setAddress("http://localhost:8080/wbInter/HelloWorld");

        factory.setServiceBean(newHelloWorldImpl());

      

       factory.getInInterceptors().add(newMessageInterceptor(Phase.RECEIVE));

       factory.getOutInterceptors().add(newMessageInterceptor(Phase.SEND));

      

       factory.create();

      

       System.out.println("Serverstart ~~~~~");

       Thread.sleep(5*1000*60);

       System.exit(0);

       System.out.println("Serverexit~~~");

      

      

    }

 

}

十、运行DeployInteceptorClient.java,运行结果为

Server start ~~~~~

十一、  新建HelloWorldServiceClient.java类

package com.firstws.interceptor;

 

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

 

importcom.firstws.test.HelloWorld;

 

public classHelloWorldServiceClient {

 

    /**

     * @param args

     */

    publicstatic void main(String[] args) {

       JaxWsProxyFactoryBeanclient = new JaxWsProxyFactoryBean();

       client.setServiceClass(HelloWorld.class);

       client.setAddress("http://localhost:8080/wbInter/HelloWorld");

      

       HelloWorldservice = (HelloWorld) client.create();

       System.out.println("[result]"+service.sayHi("张述飞"));

    }

 

}

十二、  运行HelloWorldServiceClient.java,客户端运行结果为

[result]Hello 张述飞

 

服务端运行结果是

Server start ~~~~~

###########handlerMessage############

{org.apache.cxf.message.Message.PROTOCOL_HEADERS={Accept=[*/*],Cache-Control=[no-cache], connection=[keep-alive], Content-Length=[191],content-type=[text/xml; charset=UTF-8],

~~~~~

Content-Type=text/xml;charset=UTF-8}##null

null##null

sayHi方法被调用!

###########handlerMessage############

{javax.xml.ws.wsdl.port={http://test.firstws.com/}HelloWorldPort,org.apache.cxf.ws.policy.EffectivePolicy=org.apache.cxf.ws.policy.EffectivePolicyImpl@151ac10,

 

org.apache.cxf.service.model.BindingMessageInfo=org.apache.cxf.service.model.BindingMessageInfo@f77511,Content-Type=text/xml, org.apache.cxf.message.Message.RESPONSE_CODE=200,org.apache.cxf.headers.Header.list=[]}##null

 

=====================================================================

 

到这里为止,基本上的拦截器已经做完了,下面这部分将是和Spring嵌套使用了!!

十三、  下面这部分引用的是(达拉斯母牛的CXF实战之自定义拦截器(五)),博客地址:http://blog.csdn.net/accountwcx/article/details/47147831

在这里先谢谢他的分享!!如果侵犯了你的权益,请告诉我,我撤下来!

 

十四、  权限认证拦截器处理SOAPHeader中的认证信息,客户端在发起请求时在SOAPHeader中添加认证信息,服务端在接收到请求后,校验认证信息,校验通过则继续执行,校验不通过则返回错误。

 

<!-- 认证信息格式如下 -->

<auth xmlns="http://localhost:8080/auth">

    <name>admin</name>

    <password>admin</password>

</auth>

十五、  客户端代码AuthAddInterceptor.java

package com.firstws.spring;

 

import java.util.List;

 

import javax.xml.namespace.QName;

 

importorg.apache.cxf.binding.soap.SoapMessage;

importorg.apache.cxf.headers.Header;

importorg.apache.cxf.helpers.DOMUtils;

importorg.apache.cxf.interceptor.Fault;

importorg.apache.cxf.phase.AbstractPhaseInterceptor;

importorg.apache.cxf.phase.Phase;

import org.w3c.dom.Document;

import org.w3c.dom.Element;

 

public class AuthAddInterceptorextends AbstractPhaseInterceptor<SoapMessage> {

 

    publicAuthAddInterceptor() {

       super(Phase.PREPARE_SEND);

    }

 

    publicvoid handleMessage(SoapMessage message) throws Fault {

       List<Header>headers = message.getHeaders();

       Documentdoc = DOMUtils.createDocument();

       Elementauth = doc.createElementNS("http://zhangshufei/auth","auth");

      

       Elementname = doc.createElement("name");

       name.setTextContent("admin");

      

       Elementpassword = doc.createElement("password");

       password.setTextContent("admin");

      

       auth.appendChild(name);

       auth.appendChild(password);

      

       headers.add(newHeader(new QName(""),auth));

    }

 

}

 

十六、  验证代码AuthValidateInterceptor.java

package com.firstws.spring;

 

import java.util.List;

 

import javax.xml.namespace.QName;

 

importorg.apache.cxf.binding.soap.SoapMessage;

importorg.apache.cxf.headers.Header;

import org.apache.cxf.interceptor.Fault;

importorg.apache.cxf.phase.AbstractPhaseInterceptor;

importorg.apache.cxf.phase.Phase;

import org.w3c.dom.Element;

import org.w3c.dom.NodeList;

 

public classAuthValidateInterceptor extends AbstractPhaseInterceptor<SoapMessage> {

 

    publicAuthValidateInterceptor() {

       super(Phase.PRE_INVOKE);

    }

 

    publicvoid handleMessage(SoapMessage message) throws Fault {

       System.out.println("哈哈开始验证了!");

       List<Header>headers = message.getHeaders();

      

       if(headers == null || headers.size() < 1) {

           thrownew Fault(new Exception("无授权信息!"));

       }

       Elementauth = null;

      

       for(Header header : headers) {

           QNameqname = header.getName();

           Stringns = qname.getNamespaceURI();

           StringtagName = qname.getLocalPart();

           if(ns != null && ns.equals("http://zhangshufei/auth")&& tagName != null && tagName.equals("auth")) {

              auth= (Element)header.getObject();

              break;

           }

       }

      

       if(auth == null) {

           thrownew Fault(new Exception("无授权信息!"));

       }

      

       NodeListnameList = auth.getElementsByTagName("name");

       NodeListpwdList = auth.getElementsByTagName("password");

       if(nameList.getLength() != 1 || pwdList.getLength() != 1) {

           thrownew Fault(new Exception("授权信息错误!"));

       }

          

       Stringname = nameList.item(0).getTextContent();

       Stringpassword = pwdList.item(0).getTextContent();

      

       if(!"admin".equals(name) || !"admin".equals(password)) {

           thrownew Fault(new Exception("授权信息错误!"));

       }     

    }

}

十七、  applicationContext.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:aop="http://www.springframework.org/schema/aop"

    xmlns:tx="http://www.springframework.org/schema/tx"

    xmlns:context="http://www.springframework.org/schema/context"

    xmlns:jaxws="http://cxf.apache.org/jaxws"

    xsi:schemaLocation="

    http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-3.2.xsd

    http://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx-3.2.xsd

    http://www.springframework.org/schema/aophttp://www.springframework.org/schema/aop/spring-aop-3.2.xsd

    http://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-3.2.xsd

    http://cxf.apache.org/jaxwshttp://cxf.apache.org/schemas/jaxws.xsd" >

   

    <import resource="classpath:META-INF/cxf/cxf.xml"/>

    <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>

   

    <bean id="hello" class="com.firstws.test.HelloWorldImpl"/>

    <jaxws:endpoint id="helloWorld" implementor="#hello" address="/HelloWorld">

       <jaxws:inInterceptors>

           <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"></bean>

           <bean class="com.firstws.spring.AuthValidateInterceptor"></bean>

       </jaxws:inInterceptors>

       <jaxws:outInterceptors>

           <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"></bean>

       </jaxws:outInterceptors>

    </jaxws:endpoint>

    <!--

    <bean id="myhw"class="com.firstws.test.HelloWorld"factory-bean="clientFactory" factory-method="create" />

    <bean id="clientFactory"class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">

        <propertyname="serviceClass"value="com.firstws.test.HelloWorld"/>

    <propertyname="address"value="http://localhost:8080/wbInter/HelloWorld"/>

    </bean>

    -->

</beans>

十八、  web.xml

<?xml version="1.0"encoding="UTF-8"?>

<web-app version="2.5"

    xmlns="http://java.sun.com/xml/ns/javaee"

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

  <display-name></display-name>

  <context-param>

    <param-name>contextConfigLocation</param-name>

    <param-value>

          classpath:applicationContext.xml

      </param-value>

  </context-param>

  <listener>

    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

  </listener>

  <servlet>

    <servlet-name>CXFService</servlet-name>

    <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>

  </servlet>

  <servlet-mapping>

    <servlet-name>CXFService</servlet-name>

    <url-pattern>/*</url-pattern>

  </servlet-mapping>

  <welcome-file-list>

    <welcome-file>index.jsp</welcome-file>

  </welcome-file-list>

</web-app>

 

十九、  所引用的jar包

aopalliance-1.0.jar

asm-3.3.1.jar

commons-logging-1.1.3.jar

cxf-core-3.0.7.jar

cxf-manifest.jar

cxf-rt-bindings-soap-3.0.7.jar

cxf-rt-databinding-jaxb-3.0.7.jar

cxf-rt-frontend-jaxws-3.0.7.jar

cxf-rt-frontend-simple-3.0.7.jar

cxf-rt-transports-http-3.0.7.jar

cxf-rt-transports-http-jetty-3.0.7.jar

cxf-rt-ws-addr-3.0.7.jar

cxf-rt-ws-policy-3.0.7.jar

cxf-rt-wsdl-3.0.7.jar

geronimo-jaxws_2.2_spec-1.2.jar

jaxb-api-2.2.11.jar

jaxb-core-2.2.11.jar

jaxb-impl-2.2.11.jar

jetty-continuation-8.1.15.v20140411.jar

jetty-http-8.1.15.v20140411.jar

jetty-io-8.1.15.v20140411.jar

jetty-security-8.1.15.v20140411.jar

jetty-server-8.1.15.v20140411.jar

jetty-util-8.1.15.v20140411.jar

neethi-3.0.3.jar

servlet-api.jar

slf4j-api-1.7.9.jar

slf4j-jdk14-1.7.9.jar

spring-aop-3.2.14.RELEASE.jar

spring-beans-3.2.14.RELEASE.jar

spring-context-3.2.14.RELEASE.jar

spring-core-3.2.14.RELEASE.jar

spring-expression-3.2.14.RELEASE.jar

spring-web-3.2.14.RELEASE.jar

stax2-api-3.1.4.jar

woodstox-core-asl-4.4.1.jar

wsdl4j-1.6.3.jar

xmlschema-core-2.2.1.jar

二十、  客户端程序InterceperSpringTest.java

package com.firstws.spring;

 

importorg.apache.cxf.interceptor.LoggingInInterceptor;

importorg.apache.cxf.interceptor.LoggingOutInterceptor;

importorg.apache.cxf.jaxws.JaxWsProxyFactoryBean;

 

import com.firstws.test.HelloWorld;

 

public class InterceperSpringTest{

   

    publicstatic void main(String[] args) {

       JaxWsProxyFactoryBeanfactory = new JaxWsProxyFactoryBean();

       factory.setServiceClass(HelloWorld.class);

       factory.setAddress("http://localhost:8080/wbInter/HelloWorld");

      

       factory.getInInterceptors().add(newLoggingInInterceptor());

       factory.getOutInterceptors().add(newLoggingOutInterceptor());

      

       factory.getOutInterceptors().add(newAuthAddInterceptor());

       factory.getOutInterceptors().add(newAuthValidateInterceptor());

      

       HelloWorldhw = (HelloWorld) factory.create();

       Stringresult = hw.sayHi("张述飞");

       System.out.println("终于出来了=="+result);

    }

 

}

 

=====================================================================

这里注意先要启动Tomcat服务器,再运行InterceperSpringTest,在服务器端会显示

2016-1-6 14:02:50org.apache.cxf.services.HelloWorldImplService.HelloWorldImplPort.HelloWorld

信息: Inbound Message

----------------------------

ID: 1

Address:http://localhost:8080/wbInter/HelloWorld

Encoding: UTF-8

Http-Method: POST

Content-Type: text/xml;charset=UTF-8

Headers: {Accept=[*/*],cache-control=[no-cache], connection=[keep-alive], Content-Length=[307],content-type=[text/xml; charset=UTF-8], host=[localhost:8080],pragma=[no-cache], SOAPAction=[""], user-agent=[Apache CXF 3.0.7]}

Payload: <soap:Envelopexmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><authxmlns="http://zhangshufei/auth"><name>admin</name><password>admin</password></auth></soap:Header><soap:Body><ns2:sayHixmlns:ns2="http://test.firstws.com/"><arg0>张述飞</arg0></ns2:sayHi></soap:Body></soap:Envelope>

--------------------------------------

哈哈开始验证了!

sayHi方法被调用!

2016-1-6 14:02:51org.apache.cxf.services.HelloWorldImplService.HelloWorldImplPort.HelloWorld

信息: Outbound Message

---------------------------

ID: 1

Response-Code: 200

Encoding: UTF-8

Content-Type: text/xml

Headers: {}

Payload: <soap:Envelopexmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:sayHiResponsexmlns:ns2="http://test.firstws.com/"><return>Hello 张述飞</return></ns2:sayHiResponse></soap:Body></soap:Envelope>

--------------------------------------

 

 

在客户端会显示,在这里不知道为什么会报一个跳过拦截的警告,有知道的,请分享一下,谢谢!!

警告: Skipping interceptorcom.firstws.spring.AuthValidateInterceptor: Phase pre-invoke specified does notexist.

2016-1-6 14:02:50 org.apache.cxf.services.HelloWorldService.HelloWorldPort.HelloWorld

信息: Outbound Message

---------------------------

ID: 1

Address:http://localhost:8080/wbInter/HelloWorld

Encoding: UTF-8

Http-Method: POST

Content-Type: text/xml

Headers: {Accept=[*/*], SOAPAction=[""]}

Payload: <soap:Envelopexmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><authxmlns="http://zhangshufei/auth"><name>admin</name><password>admin</password></auth></soap:Header><soap:Body><ns2:sayHixmlns:ns2="http://test.firstws.com/"><arg0>张述飞</arg0></ns2:sayHi></soap:Body></soap:Envelope>

--------------------------------------

2016-1-6 14:02:51org.apache.cxf.services.HelloWorldService.HelloWorldPort.HelloWorld

信息: Inbound Message

----------------------------

ID: 1

Response-Code: 200

Encoding: UTF-8

Content-Type:text/xml;charset=UTF-8

Headers:{content-type=[text/xml;charset=UTF-8], Date=[Wed, 06 Jan 2016 06:02:51 GMT],Server=[Apache-Coyote/1.1], transfer-encoding=[chunked]}

Payload: <soap:Envelopexmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:sayHiResponsexmlns:ns2="http://test.firstws.com/"><return>Hello 张述飞</return></ns2:sayHiResponse></soap:Body></soap:Envelope>

--------------------------------------

终于出来了==Hello 张述飞

 

====================================================================

最后注意一个错误

org.apache.cxf.interceptor.Fault:Could not send Message.

    atorg.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)

~~~~~~~

这个有可能是没有启动Tomcat,或者

factory.setAddress("http://localhost:8080/wbInter/HelloWorld”)的地址写的不对!!

 

好了,到这里为止,CXF自定义拦截器已经做出来了,另外吐槽一下CSDN的博客发布,能不能直接导入word格式的文件包括里面的图片,每次发布博客时,先在Word中写好,然后复制粘贴,最后再把图片一个个的复制出来,然后才能填加到博客中,很不友好啊!还能不能好好的玩耍了,能不能不让我们这群懒人们少动一下啊,再智能一下好吗???

 

代码下载地址: http://download.csdn.net/detail/zhangshufei8001/9393027

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值