OpenAPI 3 display SOAP Webservice

49 views Asked by At

I am currently working on to write the OpenAPI to display the SOAP API as REST API onto the swagger.

I am currently using the Public SOAP Webservice and trying to use Java application to convert into the OpenAPI format. This is the Public SOAP webservice site -> https://www.dataaccess.com/webservicesserver/NumberConversion.wso

I wonder if it is possible to indicate the Request URL (highlighted in PURPLE COLOR on the photo) without appending the REST API (highlighted in RED color on the photo).

enter image description here

Attached the OpenAPI

openapi: 3.0.1
info:
  title: SOAP API to REST API
  version: 3.0.3
servers:
- url: https://www.dataaccess.com/webservicesserver/NumberConversion.wso
paths:
  /NumberToWords:
    post:
      operationId: NumberToWords
      requestBody:
        content:
          text/xml:
            schema:
              $ref: '#/components/schemas/rootElement_NumberToWords'
        required: true
      responses:
        default:
          description: Default Description
          content:
            text/xml charset=UTF-8:
              schema:
                $ref: '#/components/schemas/rootElement_NumberToWordsResponse'
      x-wso2-soap:
        x-soap-style: document
        soap-action: ""
        x-soap-message-type: document
        soap-operation: NumberToWords
        namespace: http://www.dataaccess.com/webservicesserver/
        x-soap-version: "1.2"
  /NumberToDollars:
    post:
      operationId: NumberToDollars
      requestBody:
        content:
          text/xml:
            schema:
              $ref: '#/components/schemas/rootElement_NumberToDollars'
        required: true
      responses:
        default:
          description: Default Description
          content:
            text/xml charset=UTF-8:
              schema:
                $ref: '#/components/schemas/rootElement_NumberToDollarsResponse'
      x-wso2-soap:
        x-soap-style: document
        soap-action: ""
        x-soap-message-type: document
        soap-operation: NumberToDollars
        namespace: http://www.dataaccess.com/webservicesserver/
        x-soap-version: "1.2"
components:
  schemas:
    NumberToWordsResult:
      type: string
      xml: {}
    rootElement_NumberToWordsResponse:
      type: object
      properties:
        Body:
          type: object
          properties:
            NumberToWordsResponse:
              type: object
              properties:
                NumberToWordsResult:
                  type: string
                  xml: {}
              xml:
                namespace: http://www.dataaccess.com/webservicesserver/
          xml:
            prefix: soap
      xml:
        name: Envelope
        namespace: http://schemas.xmlsoap.org/soap/envelope/
        prefix: soap
    dNum:
      type: integer
      xml: {}
    rootElement_NumberToDollars:
      type: object
      properties:
        Body:
          type: object
          properties:
            NumberToDollars:
              type: object
              properties:
                dNum:
                  type: integer
                  xml: {}
              xml:
                namespace: http://www.dataaccess.com/webservicesserver/
          xml:
            prefix: soap
      xml:
        name: Envelope
        namespace: http://schemas.xmlsoap.org/soap/envelope/
        prefix: soap
    ubiNum:
      type: integer
      xml: {}
    rootElement_NumberToWords:
      type: object
      properties:
        Body:
          type: object
          properties:
            NumberToWords:
              type: object
              properties:
                ubiNum:
                  type: integer
                  xml: {}
              xml:
                namespace: http://www.dataaccess.com/webservicesserver/
          xml:
            prefix: soap
      xml:
        name: Envelope
        namespace: http://schemas.xmlsoap.org/soap/envelope/
        prefix: soap
    NumberToDollarsResult:
      type: string
      xml: {}
    rootElement_NumberToDollarsResponse:
      type: object
      properties:
        Body:
          type: object
          properties:
            NumberToDollarsResponse:
              type: object
              properties:
                NumberToDollarsResult:
                  type: string
                  xml: {}
              xml:
                namespace: http://www.dataaccess.com/webservicesserver/
          xml:
            prefix: soap
      xml:
        name: Envelope
        namespace: http://schemas.xmlsoap.org/soap/envelope/
        prefix: soap
1

There are 1 answers

0
Lorna Mitchell On

OpenAPI is a description format that identifies operations by their URL and HTTP verb. Therefore it is very difficult to describe a SOAP service using OpenAPI because SOAP uses a single URL, and the different operations are identified by the contents of the body request. I don't have any advice for you, other than to recognise that it's difficult because these two tools have very different views of what an API is.

If you need documentation for your SOAP service, it might be better to look for SOAP-specific tools (note for future users: this answer may be invalidated by OpenAPI 4.0 but that is still in its early stages). I'm sorry that this isn't the answer you wanted!