이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 4. Migrating a SOAP application to RESTful web services


You can use the WSDL-to-Camel Rest wizard to migrate from an existing JAX-WS SOAP web services implementation to a RESTful web services implementation by using an existing WSDL. The wizard is available as part of Fuse Tooling and it is based on the wsdl2rest utility, available in Github wsdl2rest project.

It supports the following specifications/configurations:

  • Document/literal (doc/lit)
  • Document/literal Wrapped (doc/lit wrap)
  • RPC/literal (rpclit)

4.1. Wizard workflow

The wizard uses a WSDL path which can be a valid URL (in the file:// URL form) or a remote URL (using http or https) and the selected Fuse project. In the wizard, you provide the paths for the generated Java code, the generated Camel configuration file, the target address for the generated camel endpoint, and the bean implementation class.

The wizard generates the destination Java and Camel paths based on the project. The generated Java code is available in src/main/java and the Camel file in an appropriate location for Spring or Blueprint, such as src/main/resources/META-INF/spring.

You can modify the generated classes and configure them to a certain point.

4.2. Prerequisites

Before you begin, you must meet these prerequisites:

  • A pre-existing Fuse Integration Project. You can create a new project using the FileNewFuse Integration Project wizard.
  • A WSDL file accessible through URL. It can be local (file:// url) or remote (http or https).

4.3. Migrating a sample SOAP application to RESTful web services

Follow these steps to run the wizard:

  1. In CodeReady Studio, select your Fuse project in the Project Explorer view.
  2. Right-click on the Fuse project and then select New Camel Rest DSL from WSDL.

    The Select Incoming WSDL and Project for Generated Output page opens. The Destination Project field is automatically pre-populated with the Fuse project selected in the Project Explorer. This project is the destination for the artifacts that the wizard generates.

    wsdl to rest p1
  3. For WSDL File, specify the original SOAP service for processing.
  4. Click Next. The Specify Advanced Options for WSDL-to-REST Processing page appears.

    wsdl to rest p2
    1. For Destination Java Folder, specify the location of the CXF-generated Java classes.
    2. For Destination Camel Folder, specify the location of the generated Camel Rest DSL configuration file.

      Note

      The path and name of the generated Camel file varies based on the type of Camel project:

      • For Spring projects: src/main/resources/META-INF/rest-camel-context.xml
      • For Spring Boot projects: src/main/resources/spring/rest-springboot-context.xml
      • For Blueprint projects: src/main/resources/OSGI-INF/rest-blueprint-context.xml
    3. Optionally, for Target Service Address provide the SOAP address specified in the WSDL binding. You can change this option to match the actual address of the SOAP service referenced by the WSDL.
    4. Optionally, for Target REST Service Address provide the URL for accessing the REST service. This URL is decomposed into settings for the <restConfiguration> and <rest> tags in the Rest DSL to specify the complete URL for REST operations mapped to the SOAP service.
  5. Click Finish to create two files as the output:

    • The Camel configuration with Rest DSL.
    • Java classes from CXF to wrap the SOAP service.
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.