欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
JSR 181 Annotations
本文來(lái)自:http://xfire.codehaus.org/JSR+181+Annotations
We are working on adding JSR 181 2.0 support for annotations in XFire via Java 5 and commons-attributes. The Java 5 implementation will follow the JSR 181 spec and the commons-attributes implementation will mimic the spec in a pre-Java 5 way.

Currently we have not passed the TCK and this is available only in early access form only. However, what we have is fairly stable and we are working on passing the TCK as soon as it is out. (Yes we know the JSR 181 1.0 TCK is out, be we are intent on passing the 2.0 version as we are implementing JAX-WS as well).

As covered before, ServiceFactories are used to create services from classes. The default ServiceFactory is ObjectServiceFactory. To use annotations you must use the AnnotationsServiceFactory. You must pass it an annotation reader in the constructor which will read the particular type of annotation you are using.

Using Java 5 Annotations

XFire xfire = XFireFactory.getInstance().getXFire();AnnotationServiceFactory factory = new AnnotationServiceFactory(xfire.getTransportManager());Service service = factory.create(YourService.class)xfire.getServiceRegistry().register(service);

In your services.xml, it would look like this:

<service><name>ServiceName</name><namespace>urn:your:namespace</namespace><serviceClass>your.service.Class</serviceClass><serviceFactory>org.codehaus.xfire.jaxws.JAXWSServiceFactory</serviceFactory></service>

 

The jar with the Java 5 JSR 181 annotations can be found here

Using Commons-Attributes Annotations

To use the commons-attributes annotations, you will need to follow these instructions on how to install the commons-attributes ant or maven plugin.

XFire xfire = XFireFactory.getInstance().getXFire();TypeMappingRegistry registry = new DefaultTypeMappingRegistry();AnnotationServiceFactory factory = new AnnotationServiceFactory(xfire.getTransportManager());Service service = factory.create(YourService.class)xfire.getServiceRegistry().register(service);

In your services.xml, it would look like this:

<service><name>ServiceName</name><namespace>urn:your:namespace</namespace><serviceClass>your.service.Class</serviceClass><serviceFactory>org.codehaus.xfire.annotations.AnnotationServiceFactory</serviceFactory></service>

Writing Services with Annotations

Javadocs (See the javax.jws packages only).

Example:

import javax.jws.WebMethod;import javax.jws.WebParam;import javax.jws.WebResult;import javax.jws.WebService;@WebService(name = "EchoService", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld")        public class Jsr181EchoService{@WebMethod(operationName = "echoString", action = "urn:EchoString")@WebResult(name = "echoResult")public String echo(@WebParam(name = "echoParam", header = true) String input){return input;}}

Alternatively you can place your annotations in your interface and have your implementation refer to it as shown below.

The interface:

package com.example;import javax.jws.WebMethod;import javax.jws.WebParam;import javax.jws.WebResult;import javax.jws.WebService;@WebService(name = "EchoService",  targetNamespace = "http://www.openuri.org/2004/04/HelloWorld")public interface Jsr181EchoService{@WebMethod(operationName = "echoString", action = "urn:EchoString")@WebResult(name = "echoResult")public String echo(@WebParam(name = "echoParam", header = true) String input);}

and the implementation:

package com.example;import javax.jws.WebService;@WebService(endpointInterface = "com.example.Jsr181EchoService")public class Jsr181EchoServiceImpl{public String echo(String input){return input;}}

To do this with commons-attributes instead, you will need to import the attributes from a different location and use the commons-attributes syntax:

import org.codehaus.xfire.annotations.commons.WebMethod;import org.codehaus.xfire.annotations.commons.WebParam;import org.codehaus.xfire.annotations.commons.WebResult;import org.codehaus.xfire.annotations.commons.WebService;/*** @@WebService(name = "EchoService", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld") * @@org.codehaus.xfire.annotations.commons.soap.SOAPBinding(style = 1)*/public class CommonsEchoService{/*** Returns the input.** @param input the input.* @return the input.* @@WebMethod(operationName = "echoString", action="urn:EchoString")* @@.echoParam WebParam("echoParam")* @@.return WebResult("echoResult")*/public String echo(String inputString){return inputString;}}

Using custom annotations 

Additionaly XFire provides some annotations which are not part of JSR 181, but allows to use XFire specific functionality .

package org.codehaus.xfire.annotations;@EnableMTOM@ServiceProperty(key="singlePropertyKey",list={"value3","value2"} )@ServiceProperties*(properties={@ServiceProperty(key="key12",value="value12")})@WebService(name="EchoService", targetNamespace="http://www.open.uri.org/2004/04/HelloWorld" )public class Jsr181EchoService {}

@EnableMTOM - enable MTOM on service

@ServiceProperty - allows to specify property on given serwise ( instead of creating <poperties><property key="propertyKey">propertyValue</property></properties> tags in service configuration file )

@ServicesProperties - allows to specify as many properties as you want, at once. 

本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
使用 xfire 快速發(fā)布 WebService
在Spring中使用XFire構建Web Service應用
web service開(kāi)發(fā)的完整示例
WebService
Java WebService入門(mén)實(shí)例
xfire+spring配置webservice實(shí)例講解
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久