JAVA开发ws_使用spring-ws进行webservice服务器端的开发

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

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

This web application context contains Spring-WS beans. The beans

defined in this context are automatically detected by Spring-WS,

similar to the way Controllers are picked up in Spring Web MVC.

class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping">

Detects @PayloadRoot annotations on @Endpoint bean methods.

The MarshallingAirlineEndpoint has such annotations. It uses

two interceptors: one that logs the message payload, and the

other validates it accoring to the 'airline.xsd' schema

file.

class="org.springframework.ws.wsdl.wsdl11.DynamicWsdl11Definition">

This bean definition represents a WSDL definition that is

generated at runtime, based on the builder defined below. It

can be retrieved by going to /echo/echo.wsdl (i.e. the bean

name corresponds to the filename).

The builder creates a WSDL from the 'echo.xsd' schema.

It detects all elements that ends with 'Request', finds

corresponding 'Response' messages, and creates an

operation based on that. All operations are put in a

portType with name 'Echo', and binding and service are

created.

class="org.springframework.ws.wsdl.wsdl11.builder.XsdBasedSoap11Wsdl4jDefinitionBuilder">

value="http://localhost:8080/echoweb/services" />

This endpoint handles echo requests.

This bean is our "business" service.

class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor">

class="org.springframework.ws.soap.server.endpoint.interceptor.SoapEnvelopeLoggingInterceptor">

class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter">

class="org.springframework.oxm.jaxb.Jaxb2Marshaller">

也就是说用spring开发webservice需要配置一下文件:

1.EndPoint,如果使用标记的话,就可以不用继承任何类

2.EndpointMapping,Detects @PayloadRoot annotations on @Endpoint bean methods.

3.DynamicWsdl11Definition。动态生成WSDL

如果使用JAXB作为Object和XML的映射,那么还需要

4.Marshaller一般为Jaxb2Marshaller

5.如果是使用的标记的话,还需要MarshallingMethodEndpointAdapter,一般现在使用

GenericMarshallingMethodEndpointAdapter

posted on 2007-12-25 17:48 刘铮 阅读(5742) 评论(0)  编辑  收藏 所属分类: WebService

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值