Skip to content

Commit ae29129

Browse files
authored
docs(soap): improves scripted examples.
1 parent e553dc1 commit ae29129

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

docs/soap_plugin.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -285,35 +285,35 @@ response:
285285

286286
Now, `example.groovy` can control the responses, such as:
287287

288-
1. **the content of a file to return**
289-
290-
```groovy
291-
respond().withFile('some-file.xml')
292-
```
293-
294-
2. **a literal string to return**
295-
296-
```groovy
297-
respond().withContent('''<?xml version="1.0" encoding="UTF-8"?>
298-
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope">
299-
<env:Header/>
300-
<env:Body>
301-
<getPetByIdResponse xmlns="urn:com:example:petstore">
302-
<id>3</id>
303-
<name>Custom pet name</name>
304-
</getPetByIdResponse>
305-
</env:Body>
306-
</env:Envelope>
307-
''')
308-
```
309-
310-
3. **a specific HTTP status code**
311-
312-
Setting the status code to 500 will trigger a fault message to be returned if one is defined within the WSDL document.
313-
314-
```groovy
315-
respond().withStatusCode(500)
316-
```
288+
#### Return the content of a file
289+
290+
```groovy
291+
respond().withFile('some-file.xml')
292+
```
293+
294+
#### Return a literal string
295+
296+
```groovy
297+
respond().withContent('''<?xml version="1.0" encoding="UTF-8"?>
298+
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope">
299+
<env:Header/>
300+
<env:Body>
301+
<getPetByIdResponse xmlns="urn:com:example:petstore">
302+
<id>3</id>
303+
<name>Custom pet name</name>
304+
</getPetByIdResponse>
305+
</env:Body>
306+
</env:Envelope>
307+
''')
308+
```
309+
310+
#### Return a specific HTTP status code
311+
312+
Setting the status code to 500 will trigger a fault message to be returned if one is defined within the WSDL document.
313+
314+
```groovy
315+
respond().withStatusCode(500)
316+
```
317317

318318
#### Scripting examples
319319

0 commit comments

Comments
 (0)