`
zsjg13
  • 浏览: 142403 次
  • 性别: Icon_minigender_1
  • 来自: 安徽
社区版块
存档分类
最新评论

Frontend

    博客分类:
  • CXF
阅读更多

Frontend

CXF provides the concept of frontend modeling, which lets you create web services 

using different frontend APIs. The APIs let you create a web service using simple 

factory beans and JAX-WS implementation. It also lets you create dynamic web 

service clients. The primary frontend supported by CXF is JAX-WS. We will look  

at how to use the Frontend programming model in the next chapter.

 

JAX-WS

JAX-WS is a specification that establishes the semantics to develop, publish, and 

consume web services. JAX-WS simplifies web service development. It defines 

Java-based APIs that ease the development and deployment of web services. 

The specification supports WS-Basic Profile 1.1 that addresses web service 

interoperability. It effectively means a web service can be invoked or consumed by 

a client written in any language. JAX-WS also defines standards such as JAXB and 

SAAJ. CXF provides support for complete JAX-WS stack.

 

JAXB provides data binding capabilities by providing a convenient way to map XML 

schema to a representation in Java code. The JAXB shields the conversion of XML 

schema messages in SOAP messages to Java code without the developers seeing 

XML and SOAP parsing. JAXB specification defines the binding between Java and 

XML Schema. SAAJ provides a standard way of dealing with XML attachments 

contained in a SOAP message.

 

JAX-WS also speeds up web service development by providing a library of 

annotations to turn Plain Old Java classes into web services and specifies a detailed 

mapping from a service defined in WSDL to the Java classes that will implement that 

service. Any complex types defined in WSDL are mapped into Java classes following 

 the mapping defined by the JAXB specification.

 

As discussed earlier, two approaches for web service development exist: Code-First 

and Contract-First. With JAX-WS, you can perform web service development using 

 one of the said approaches, depending on the nature of the application.

 

With the Code-first approach, you start by developing a Java class and interface and 

annotating the same as a web service. The approach is particularly useful where  

Java implementations are already available and you need to expose implementations 

as services.

 

You typically create a Service Endpoint Interface (SEI) that defines the service 

methods and the implementation class that implements the SEI methods. The 

consumer of a web service uses SEI to invoke the service functions. The SEI directly 

corresponds to a wsdl:portType element. The methods defined by SEI correspond 

to the wsdl:operation element. 

@WebService

public interface OrderProcess {

    String processOrder(Order order);

}

 

JAX-WS makes use of annotations to convert an SEI or a Java class to a web  

service. In the above example, the @WebService annotation defined above the 

interface declaration signifies an interface as a web service interface or Service 

Endpoint Interface.

 

In the Contract-first approach, you start with the existing WSDL contract, and generate 

Java class to implement the service. The advantage is that you are sure about what to 

expose as a service since you define the appropriate WSDL Contract-first. Again the 

contract definitions can be made consistent with respect to data types so that it can be 

easily converted in Java objects without any portability issue. In Chapter 3 we will look 

at how to develop web services using both these approaches.

 

 WSDL contains different elements that can be directly mapped to a Java class 

that implements the service. For example, the wsdl:portType element is directly 

mapped to SEI, type elements are mapped to Java class types through the use of Java 

Architecture of XML Binding (JAXB), and the wsdl:service element is mapped to 

a Java class that is used by a consumer to access the web service.

 

The WSDL2Java tool can be used to generate a web service from WSDL. It has various 

options to generate SEI and the implementation web service class. As a developer, 

you need to provide the method implementation for the generated class. If the WSDL 

includes custom XML Schema types, then the same is converted into its equivalent 

Java class.

 

Simple frontend

Apart from JAX-WS frontend, CXF also supports what is known as 'simple frontend'. 

The simple frontend provides simple components or Java classes that use reflection 

to build and publish web services. It is simple because we do not use any annotation 

to create web services. In JAX-WS, we have to annotate a Java class to denote it 

as a web service and use tools to convert between a Java object and WSDL. The 

simple frontend uses factory components to create a service and the client. It does 

so by using Java reflection API. In Chapter 3 we will look at how to develop simple 

frontend web services

The following code shows a web service created using simple frontend:

// Build and publish the service

OrderProcessImpl orderProcessImpl = new OrderProcessImpl();

ServerFactoryBean svrFactory = new ServerFactoryBean();

svrFactory.setServiceClass(OrderProcess.class);

svrFactory.setAddress("http://localhost:8080/OrderProcess");

svrFactory.setServiceBean(orderProcessImpl);

svrFactory.create();

分享到:
评论

相关推荐

    cxf-rt-frontend-jaxrs-3.0.1-API文档-中文版.zip

    赠送jar包:cxf-rt-frontend-jaxrs-3.0.1.jar; 赠送原API文档:cxf-rt-frontend-jaxrs-3.0.1-javadoc.jar; 赠送源代码:cxf-rt-frontend-jaxrs-3.0.1-sources.jar; 赠送Maven依赖信息文件:cxf-rt-frontend-jaxrs...

    cxf-rt-frontend-jaxws-3.0.1-API文档-中文版.zip

    赠送jar包:cxf-rt-frontend-jaxws-3.0.1.jar; 赠送原API文档:cxf-rt-frontend-jaxws-3.0.1-javadoc.jar; 赠送源代码:cxf-rt-frontend-jaxws-3.0.1-sources.jar; 赠送Maven依赖信息文件:cxf-rt-frontend-jaxws...

    FrontEnd-java反编译工具

    Java前端(FrontEnd)是一种用于Java程序反编译的工具,它可以帮助开发者查看和理解已编译的Java字节码。在软件开发过程中,源代码通常被编译成字节码,这是一种平台无关的中间语言,Java虚拟机(JVM)能够理解和...

    cxf-rt-frontend-simple-3.0.1-API文档-中文版.zip

    赠送jar包:cxf-rt-frontend-simple-3.0.1.jar; 赠送原API文档:cxf-rt-frontend-simple-3.0.1-javadoc.jar; 赠送源代码:cxf-rt-frontend-simple-3.0.1-sources.jar; 赠送Maven依赖信息文件:cxf-rt-frontend-...

    jsonrpc-frontend:前端应用程序发送 json-rpc 请求进行测试

    标题"jsonrpc-frontend:前端应用程序发送 json-rpc 请求进行测试"表明我们要讨论的是一个专门针对前端应用的库或工具,它帮助开发者方便地发送JSON-RPC请求进行功能测试。这个工具可能包括对JSON-RPC规范的实现、...

    FrontEnd

    4. **FrontEnd Plus.txt**:这个文件可能是关于"FrontEnd"的附加信息或者使用手册,可能包含"FrontEnd plus v0.01"的特性、更新日志、使用教程等。 综合来看,这个压缩包可能包含了一个自定义的Java应用描述符工具...

    UPX Frontend v3.01

    UPX Frontend v3.01 是一个专为IT专业人士设计的应用软件,它提供了一种图形用户界面(GUI)来简化UPX(Ultimate Packer for eXecutables)的使用过程。UPX是一款开源的、免费的、强大的可执行文件打包器,能够对...

    FrontEnd 反编译工具

    本文将深入探讨“FrontEnd”这一专为JAD设计的图形化操作界面,以及其在反编译过程中的作用。 JAD,全称为Java Application Decompiler,是一款功能强大的Java字节码反编译器。它能够将已编译的Java字节码(.class...

    java反编译工具FrontEnd V2.03

    其中,"FrontEnd V2.03"是一款著名的Java CLASS文件反编译工具,专为Java开发者设计,以帮助他们查看和理解Java字节码。这个工具不仅提供了基本的反编译功能,还有其他一些实用特性,使其在同类工具中脱颖而出。 ...

    WP User Frontend Pro汉化版2.2.4

    WP User Frontend Pro是一款专为WordPress设计的强大插件,它允许网站管理员创建用户友好的前端界面,以便访客可以提交内容、注册、登录以及管理个人资料,无需进入网站后台。这款汉化版2.2.4是针对中文用户的优化...

    wp-user-frontend-pro

    "wp-user-frontend-pro"是一款针对WordPress平台的专业前端表单编辑插件,它极大地扩展了网站用户在前段操作的功能,允许非管理员级别的用户在不进入后台的情况下进行文章的编辑和发布。这款插件旨在提升用户体验,...

    FrontEnd&jad;

    而"FrontEnd&jad;"这个主题似乎关联到前端开发领域,并且与Java反编译工具有关,这对于理解、学习和分析Java代码非常有用。下面我们将详细探讨这些知识点。 首先,前端开发主要涉及HTML、CSS和JavaScript技术,它们...

    FrontEnd.exe+Jad.exe

    在IT行业中,"FrontEnd.exe+Jad.exe" 提到的这两个文件名通常是与软件开发相关的,特别是前端和编译工具。让我们详细探讨一下这两个组件及其在计算机科学和IT技术中的作用。 首先,"FrontEnd.exe" 这个名称暗示了一...

    wp-user-frontend-pro-3.7专业前端用户插件

    【wp-user-frontend-pro-3.7专业前端用户插件】是WordPress平台的一款强大插件,它极大地扩展了网站的用户交互功能,让访客无需登录后端即可完成多种操作。这款插件对于那些希望提升用户体验,特别是需要用户在前端...

    jad和frontEnd反编译器

    jad和FrontEnd就是两个常用的Java反编译器,它们能够将.class文件转换回接近原生的Java源代码。 jad是由JADSoft开发的一款开源Java反编译器。它具有高效的反编译能力,能解析Java字节码并生成可读性较高的源代码。...

    wp user frontend pro汉化版2.1.8.zip

    【标题】"wp user frontend pro汉化版2.1.8.zip" 提供的是一个针对WordPress平台的插件——WP User Frontend Pro的中文版本,版本号为2.1.8。这款插件专为增强网站用户前端交互体验而设计,使得非管理员用户也能在...

    使用Simple Frontend+Aegis方式发布并获取webservice

    在本文中,我们将探讨如何使用Apache CXF框架的Simple Frontend和Aegis绑定来发布和获取Web服务。这种方法提供了一种简洁的方式,无需过多的注解或特定于技术的接口,使得我们可以轻松地将任何类转换为Web服务。 1....

    fcitx-frontend-qt5

    fcitx-frontend-qt5的离线安装包

    FrontEnd Plus java反编译

    "FrontEnd Plus"可能是一个特定的Java反编译工具,尽管在描述中没有提供详细信息,但我们可以探讨Java反编译的一般概念和相关技术。 首先,Java的字节码是一种中间语言,它不是人类可读的形式,因此需要反编译器来...

    wp-user-frontend-pro汉化版

    【标题】"wp-user-frontend-pro汉化版"所涉及的知识点主要集中在WordPress插件的使用上,尤其是针对前端用户交互功能的增强。这个插件是WordPress平台上的一个强大工具,它允许网站访客在前端完成一系列通常需要后端...

Global site tag (gtag.js) - Google Analytics