Skip to content

Commit 939b6b9

Browse files
committed
first commit
0 parents  commit 939b6b9

File tree

9 files changed

+1481
-0
lines changed

9 files changed

+1481
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.idea/
2+
.vertx
3+
target/
4+
log/
5+
*.iml
6+
*.log

abyss-spec-transformer/README.md

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
# ABYSS SPEC TRANSFORMER
2+
3+
This application generates an OpenAPI definition file based on 3.0 specification from a wsdl which gives as a URL or directory path.
4+
An example is below
5+
6+
**Input**
7+
8+
```xml
9+
<?xml version="1.0" standalone="no"?>
10+
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
11+
xmlns="http://schemas.xmlsoap.org/wsdl/"
12+
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
13+
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
14+
xmlns:tns="http://thomas-bayer.com/blz/"
15+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
16+
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
17+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
18+
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
19+
targetNamespace="http://thomas-bayer.com/blz/">
20+
<wsdl:documentation>BLZService</wsdl:documentation>
21+
<wsdl:types>
22+
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://thomas-bayer.com/blz/">
23+
<xsd:element name="getBank" type="tns:getBankType"></xsd:element>
24+
<xsd:element name="getBankResponse" type="tns:getBankResponseType"></xsd:element>
25+
<xsd:complexType name="getBankType">
26+
<xsd:sequence>
27+
<xsd:element name="blz" type="xsd:string"></xsd:element>
28+
</xsd:sequence>
29+
</xsd:complexType>
30+
<xsd:complexType name="getBankResponseType">
31+
<xsd:sequence>
32+
<xsd:element name="details" type="tns:detailsType"></xsd:element>
33+
</xsd:sequence>
34+
</xsd:complexType>
35+
<xsd:complexType name="detailsType">
36+
<xsd:sequence>
37+
<xsd:element minOccurs="0" name="bezeichnung" type="xsd:string"></xsd:element>
38+
<xsd:element minOccurs="0" name="bic" type="xsd:string"></xsd:element>
39+
<xsd:element minOccurs="0" name="ort" type="xsd:string"></xsd:element>
40+
<xsd:element minOccurs="0" name="plz" type="xsd:string"></xsd:element>
41+
</xsd:sequence>
42+
</xsd:complexType>
43+
</xsd:schema>
44+
</wsdl:types>
45+
<wsdl:message name="getBank">
46+
<wsdl:part name="parameters" element="tns:getBank"></wsdl:part>
47+
</wsdl:message>
48+
<wsdl:message name="getBankResponse">
49+
<wsdl:part name="parameters" element="tns:getBankResponse"></wsdl:part>
50+
</wsdl:message>
51+
<wsdl:portType name="BLZServicePortType">
52+
<wsdl:operation name="getBank">
53+
<wsdl:input message="tns:getBank"></wsdl:input>
54+
<wsdl:output message="tns:getBankResponse" wsaw:Action="http://thomas-bayer.com/blz/BLZService/getBankResponse"></wsdl:output>
55+
</wsdl:operation>
56+
</wsdl:portType>
57+
<wsdl:binding name="BLZServiceSOAP11Binding" type="tns:BLZServicePortType">
58+
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"></soap:binding>
59+
<wsdl:operation name="getBank">
60+
<soap:operation style="document" soapAction=""></soap:operation>
61+
<wsdl:input>
62+
<soap:body use="literal"></soap:body>
63+
</wsdl:input>
64+
<wsdl:output>
65+
<soap:body use="literal"></soap:body>
66+
</wsdl:output>
67+
</wsdl:operation>
68+
</wsdl:binding>
69+
<wsdl:binding name="BLZServiceSOAP12Binding" type="tns:BLZServicePortType">
70+
<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"></soap12:binding>
71+
<wsdl:operation name="getBank">
72+
<soap12:operation style="document" soapAction=""></soap12:operation>
73+
<wsdl:input>
74+
<soap12:body use="literal"></soap12:body>
75+
</wsdl:input>
76+
<wsdl:output>
77+
<soap12:body use="literal"></soap12:body>
78+
</wsdl:output>
79+
</wsdl:operation>
80+
</wsdl:binding>
81+
<wsdl:binding name="BLZServiceHttpBinding" type="tns:BLZServicePortType">
82+
<http:binding verb="POST"></http:binding>
83+
<wsdl:operation name="getBank">
84+
<http:operation location="BLZService/getBank"></http:operation>
85+
<wsdl:input>
86+
<mime:content part="getBank" type="text/xml"></mime:content>
87+
</wsdl:input>
88+
<wsdl:output>
89+
<mime:content part="getBank" type="text/xml"></mime:content>
90+
</wsdl:output>
91+
</wsdl:operation>
92+
</wsdl:binding>
93+
<wsdl:service name="BLZService">
94+
<wsdl:port name="BLZServiceSOAP11port_http" binding="tns:BLZServiceSOAP11Binding">
95+
<soap:address location="http://www.thomas-bayer.com/axis2/services/BLZService"></soap:address>
96+
</wsdl:port>
97+
<wsdl:port name="BLZServiceSOAP12port_http" binding="tns:BLZServiceSOAP12Binding">
98+
<soap12:address location="http://www.thomas-bayer.com/axis2/services/BLZService"></soap12:address>
99+
</wsdl:port>
100+
<wsdl:port name="BLZServiceHttpport" binding="tns:BLZServiceHttpBinding">
101+
<http:address location="http://www.thomas-bayer.com/axis2/services/BLZService"></http:address>
102+
</wsdl:port>
103+
</wsdl:service>
104+
</wsdl:definitions>
105+
```
106+
107+
**Output**
108+
109+
```java
110+
OpenAPITransformer openAPITransformer = new OpenAPITransformer();
111+
openAPITransformer.transform("http://thomas-bayer.com/axis2/services/BLZService?wsdl");`
112+
```
113+
114+
```yaml
115+
openapi: 3.0.1
116+
info:
117+
title: BLZService
118+
version: "1.0"
119+
servers:
120+
- url: http://www.thomas-bayer.com/axis2/services/BLZService
121+
tags:
122+
- name: BLZServiceSOAP11Binding
123+
externalDocs:
124+
description: Soap 1.1 Service
125+
url: http://www.thomas-bayer.com/axis2/services/BLZService
126+
- name: BLZServiceHttpBinding
127+
externalDocs:
128+
description: HTTP Service
129+
url: http://www.thomas-bayer.com/axis2/services/BLZService
130+
- name: BLZServiceSOAP12Binding
131+
externalDocs:
132+
description: Soap 1.2 Service
133+
url: http://www.thomas-bayer.com/axis2/services/BLZService
134+
paths:
135+
/BLZService/getBank:
136+
post:
137+
tags:
138+
- BLZServiceHttpBinding
139+
operationId: getBank_HttpService
140+
requestBody:
141+
$ref: '#/components/requestBodies/getBank'
142+
responses:
143+
200:
144+
$ref: '#/components/responses/200_getBankResponse'
145+
/getBank:
146+
post:
147+
tags:
148+
- BLZServiceSOAP12Binding
149+
- BLZServiceSOAP11Binding
150+
operationId: getBank_SoapService
151+
requestBody:
152+
$ref: '#/components/requestBodies/getBank'
153+
responses:
154+
200:
155+
$ref: '#/components/responses/200_getBankResponse'
156+
components:
157+
schemas:
158+
getBankResponseType:
159+
title: getBankResponseType
160+
required:
161+
- details
162+
type: object
163+
properties:
164+
details:
165+
$ref: '#/components/schemas/detailsType'
166+
getBankResponse:
167+
title: getBankResponse
168+
required:
169+
- getBankResponseType
170+
type: object
171+
properties:
172+
getBankResponseType:
173+
$ref: '#/components/schemas/getBankResponseType'
174+
getBankType:
175+
title: getBankType
176+
required:
177+
- blz
178+
type: object
179+
properties:
180+
blz:
181+
type: string
182+
detailsType:
183+
title: detailsType
184+
required:
185+
- bezeichnung
186+
- bic
187+
- ort
188+
- plz
189+
type: object
190+
properties:
191+
bezeichnung:
192+
type: string
193+
bic:
194+
type: string
195+
ort:
196+
type: string
197+
plz:
198+
type: string
199+
getBank:
200+
title: getBank
201+
required:
202+
- getBankType
203+
type: object
204+
properties:
205+
getBankType:
206+
$ref: '#/components/schemas/getBankType'
207+
responses:
208+
200_getBankResponse:
209+
description: Successful operation
210+
content:
211+
application/xml:
212+
schema:
213+
$ref: '#/components/x-messages/getBankResponse'
214+
requestBodies:
215+
getBank:
216+
description: getBank message object as request body
217+
content:
218+
application/xml:
219+
schema:
220+
$ref: '#/components/x-messages/getBank'
221+
required: true
222+
x-messages:
223+
getBankResponse:
224+
$ref: '#/components/schemas/getBankResponse'
225+
getBank:
226+
$ref: '#/components/schemas/getBank'
227+
```

abyss-spec-transformer/pom.xml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>utilities</artifactId>
7+
<groupId>com.verapi.abyss</groupId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>abyss-spec-transformer</artifactId>
13+
14+
<properties>
15+
<cxf.version>3.3.0</cxf.version>
16+
<swagger.parser.version>2.0.9</swagger.parser.version>
17+
<snakeYaml.version>1.24</snakeYaml.version>
18+
<lombok.version>1.16.20</lombok.version>
19+
<logback.version>1.2.3</logback.version>
20+
<slf4j.version>1.7.25</slf4j.version>
21+
<junit.version>4.12</junit.version>
22+
</properties>
23+
24+
<dependencies>
25+
<dependency>
26+
<groupId>io.vertx</groupId>
27+
<artifactId>vertx-core</artifactId>
28+
</dependency>
29+
<dependency>
30+
<groupId>io.vertx</groupId>
31+
<artifactId>vertx-web</artifactId>
32+
</dependency>
33+
<dependency>
34+
<groupId>org.apache.cxf</groupId>
35+
<artifactId>cxf-rt-wsdl</artifactId>
36+
<version>${cxf.version}</version>
37+
</dependency>
38+
<dependency>
39+
<groupId>io.swagger.parser.v3</groupId>
40+
<artifactId>swagger-parser</artifactId>
41+
<version>${swagger.parser.version}</version>
42+
</dependency>
43+
<dependency>
44+
<groupId>org.yaml</groupId>
45+
<artifactId>snakeyaml</artifactId>
46+
<version>${snakeYaml.version}</version>
47+
</dependency>
48+
<dependency>
49+
<groupId>org.projectlombok</groupId>
50+
<artifactId>lombok</artifactId>
51+
<version>${lombok.version}</version>
52+
</dependency>
53+
<dependency>
54+
<groupId>ch.qos.logback</groupId>
55+
<artifactId>logback-classic</artifactId>
56+
<version>${logback.version}</version>
57+
</dependency>
58+
</dependencies>
59+
60+
61+
</project>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package io.abyss.spec.transformer;
2+
3+
import com.fasterxml.jackson.core.JsonProcessingException;
4+
import io.vertx.core.json.JsonObject;
5+
import javax.wsdl.WSDLException;
6+
7+
8+
/**
9+
* @author hakdogan ([email protected])
10+
* Created on 2019-04-22
11+
*/
12+
13+
public interface IAbyssTransformer {
14+
15+
/**
16+
*
17+
* @param parh
18+
* @return
19+
* @throws JsonProcessingException
20+
* @throws WSDLException
21+
*/
22+
JsonObject transform(String parh) throws JsonProcessingException, WSDLException;
23+
}

0 commit comments

Comments
 (0)