Leverage the Eclipse modeling framework to enhance the functionality of Jax-RPC type mappings

Source: Internet
Author: User
Tags file system soap web services root directory wsdl

Introduction

Jax-RPC, also known as JSR-101, is an important step towards completing the standard programming model, which simplifies the construction of interoperable Web services on the Java™ platform. Conversion from XML to Java type mapping model is the key to Jax-RPC, which is an implementation standard for WEB service product providers. Without such a model, WEB service product providers fall into the trap of defining specialized type mappings, which can severely affect Java interoperability issues.

Although Jax-RPC does a lot of work in supporting XML data types, there are many areas that need to be improved. Also, Jax-RPC needs to map any unsupported XML data types to the Javax.xml.soap.SOAPElement interface. The Javax.xml.soap.SOAPElement interface does not provide the user with a strongly typed Java model, which means that the user must write custom code and then parse it by soapelement instance. This is more difficult for beginners, especially when dealing with large XML fragments. This article demonstrates how to use EMF to support XML data types that do not have a standard JAX-RPC type mapping. It is not easy to generate Web services using JAX-RPC that does not support XML data types, but this article puts Web services tools and Ibm®websphere®studio application and Site Developer V5.1.2 (applica The EMF tools in tion and Site Developer provide an effective solution.

Create a supply chain WEB service

To implement the methods described in this article, you must install the WebSphere application and Site Developer V5.1.2. You can download a 60-day trial version if you want.

Create a Web project. Click menu file>new>project...>web > Dynamic Web project>next to open New Dynamic Web Project Wizard.

Enter Supplychainweb as the name of the Web project, select the Configure Advance options check box, and then click Next.

Enter Supplychainear as the name of the EAR project, and then click Finish.

Click the code icon at the top of this article to download supplychainservice.wsdl and supplychainschema.xsd to the local file system.

Import or copy supplychainservice.wsdl and supplychainschema.xsd to the root directory of the Supplychainweb project.

In the Navigator view, right-click Supplychainservice.wsdl>web services>generate Java Bean Skeleton Open the WSDL to Java bean shown in Figure 1 Skele Ton Wizard. The wizard generates a Java schema code implementation based on the information defined in the WSDL document. Accept all default settings, and then click Finish.

Figure 1.WSDL to Java Bean Skeleton Wizard

After the wizard finishes, you will see some WSDL validation errors in the Tasks view because the XML schema file (supplychainschema.xsd) has not been copied to the correct location. To correct these errors, copy the supplychainschema.xsd from the root directory of the Supplychainweb project to the/supplychainweb/webcontent/web-inf/wsdl/and/ supplychainweb/webcontent/wsdl/com/example/supplychain/www/in these two directories. Right-click Supplychainservice.wsdl>run validation to run the validation again.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.