Skip to content

Commit e276046

Browse files
committed
docs: adds single-file WSDL 1 and SOAP 1.1 example.
1 parent 143a59c commit e276046

File tree

2 files changed

+199
-0
lines changed

2 files changed

+199
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
plugin: soap
2+
wsdlFile: petstore.wsdl
3+
4+
resources:
5+
- operation: getPetById
6+
requestBody:
7+
xPath: //pets:getPetByIdRequest/pets:id
8+
value: 100
9+
xmlNamespaces:
10+
pets: urn:com:example:petstore
11+
response:
12+
statusCode: 200
13+
headers:
14+
Content-Type: application/xml
15+
content: |
16+
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
17+
<soap:Body>
18+
<pets:getPetByIdResponse xmlns:pets="urn:com:example:petstore">
19+
<pets:id>100</pets:id>
20+
<pets:name>dog</pets:name>
21+
</pets:getPetByIdResponse>
22+
</soap:Body>
23+
</soap:Envelope>
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
~ Copyright (c) 2023.
5+
~
6+
~ This file is part of Imposter.
7+
~
8+
~ "Commons Clause" License Condition v1.0
9+
~
10+
~ The Software is provided to you by the Licensor under the License, as
11+
~ defined below, subject to the following condition.
12+
~
13+
~ Without limiting other conditions in the License, the grant of rights
14+
~ under the License will not include, and the License does not grant to
15+
~ you, the right to Sell the Software.
16+
~
17+
~ For purposes of the foregoing, "Sell" means practicing any or all of
18+
~ the rights granted to you under the License to provide to third parties,
19+
~ for a fee or other consideration (including without limitation fees for
20+
~ hosting or consulting/support services related to the Software), a
21+
~ product or service whose value derives, entirely or substantially, from
22+
~ the functionality of the Software. Any license notice or attribution
23+
~ required by the License must also include this Commons Clause License
24+
~ Condition notice.
25+
~
26+
~ Software: Imposter
27+
~
28+
~ License: GNU Lesser General Public License version 3
29+
~
30+
~ Licensor: Peter Cornish
31+
~
32+
~ Imposter is free software: you can redistribute it and/or modify
33+
~ it under the terms of the GNU Lesser General Public License as published by
34+
~ the Free Software Foundation, either version 3 of the License, or
35+
~ (at your option) any later version.
36+
~
37+
~ Imposter is distributed in the hope that it will be useful,
38+
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
39+
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40+
~ GNU Lesser General Public License for more details.
41+
~
42+
~ You should have received a copy of the GNU Lesser General Public License
43+
~ along with Imposter. If not, see <https://www.gnu.org/licenses/>.
44+
-->
45+
46+
<definitions name="PetService" xmlns="http://schemas.xmlsoap.org/wsdl/"
47+
xmlns:tns="urn:com:example:petstore"
48+
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
49+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
50+
targetNamespace="urn:com:example:petstore">
51+
52+
<documentation>
53+
This is a sample WSDL 1.1 document describing the pet service.
54+
It has SOAP 1.1 bindings.
55+
</documentation>
56+
57+
<!-- Abstract type -->
58+
<types>
59+
<xs:schema targetNamespace="urn:com:example:petstore"
60+
xmlns:tns="urn:com:example:petstore"
61+
xmlns:xs="http://www.w3.org/2001/XMLSchema">
62+
63+
<xs:complexType name="petType">
64+
<xs:all>
65+
<xs:element name="id" type="xs:int"/>
66+
<xs:element name="name" type="xs:string"/>
67+
</xs:all>
68+
</xs:complexType>
69+
70+
<xs:complexType name="getPetByIdRequest">
71+
<xs:all>
72+
<xs:element name="id" type="xs:int"/>
73+
</xs:all>
74+
</xs:complexType>
75+
76+
<xs:complexType name="getPetByNameRequest">
77+
<xs:all>
78+
<xs:element name="name" type="xs:string"/>
79+
</xs:all>
80+
</xs:complexType>
81+
82+
<xs:element name="getPetByIdRequest" type="tns:getPetByIdRequest"/>
83+
<xs:element name="getPetByIdResponse" type="tns:petType"/>
84+
85+
<xs:element name="getPetByNameRequest" type="tns:getPetByNameRequest"/>
86+
<xs:element name="getPetByNameResponse" type="tns:petType"/>
87+
88+
<xs:element name="fault" type="xs:string"/>
89+
</xs:schema>
90+
</types>
91+
92+
<message name="getPetByIdRequest">
93+
<part element="tns:getPetByIdRequest" name="parameters"/>
94+
</message>
95+
<message name="getPetByIdResponse">
96+
<part element="tns:getPetByIdResponse" name="parameters"/>
97+
</message>
98+
<message name="getPetByNameRequest">
99+
<part element="tns:getPetByNameRequest" name="parameters"/>
100+
</message>
101+
<message name="getPetByNameResponse">
102+
<part element="tns:getPetByNameResponse" name="parameters"/>
103+
</message>
104+
105+
<!-- Abstract port types -->
106+
<portType name="PetPortType">
107+
<operation name="getPetById">
108+
<input message="tns:getPetByIdRequest" name="getPetByIdRequest"/>
109+
<output message="tns:getPetByIdResponse" name="getPetByIdResponse"/>
110+
</operation>
111+
<operation name="getPetByName">
112+
<input message="tns:getPetByNameRequest" name="getPetByNameRequest"/>
113+
<output message="tns:getPetByNameResponse" name="getPetByNameResponse"/>
114+
</operation>
115+
</portType>
116+
117+
<!-- Concrete Binding Over HTTP -->
118+
<binding name="HttpBinding" type="tns:PetPortType">
119+
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
120+
121+
<operation name="getPetById">
122+
<soap:operation soapAction="getPetById" style="document"/>
123+
<input name="getPetByIdRequest">
124+
<soap:body use="literal"/>
125+
</input>
126+
<output name="getPetByIdResponse">
127+
<soap:body use="literal"/>
128+
</output>
129+
</operation>
130+
<operation name="getPetByName">
131+
<soap:operation soapAction="getPetByName" style="document"/>
132+
<input name="getPetByNameRequest">
133+
<soap:body use="literal"/>
134+
</input>
135+
<output name="getPetByNameResponse">
136+
<soap:body use="literal"/>
137+
</output>
138+
</operation>
139+
</binding>
140+
141+
<!-- Concrete Binding with SOAP-->
142+
<binding name="SoapBinding" type="tns:PetPortType">
143+
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/soap"/>
144+
145+
<operation name="getPetById">
146+
<soap:operation soapAction="getPetById" style="document"/>
147+
<input name="getPetByIdRequest">
148+
<soap:body use="literal"/>
149+
</input>
150+
<output name="getPetByIdResponse">
151+
<soap:body use="literal"/>
152+
</output>
153+
</operation>
154+
155+
<operation name="getPetByName">
156+
<!-- soap:operation style omitted - fall back to soap:binding style -->
157+
<soap:operation soapAction="getPetByName"/>
158+
<input name="getPetByNameRequest">
159+
<soap:body use="literal"/>
160+
</input>
161+
<output name="getPetByNameResponse">
162+
<soap:body use="literal"/>
163+
</output>
164+
</operation>
165+
</binding>
166+
167+
<!-- Web Service offering endpoints for both bindings-->
168+
<service name="PetService">
169+
<port name="HttpEndpoint" binding="tns:HttpBinding">
170+
<soap:address location="http://www.example.com/http/"/>
171+
</port>
172+
<port name="SoapEndpoint" binding="tns:SoapBinding">
173+
<soap:address location="http://www.example.com/soap/"/>
174+
</port>
175+
</service>
176+
</definitions>

0 commit comments

Comments
 (0)