Samples for REST Request
application/json
The following table provides the samples of the REST request for the
application/json
content-type application and the
equivalent SOAP request after transformation from REST to SOAP:
Request | Equivalent SOAP Request | |
---|---|---|
Consists of only one element (qualified namespaces) |
|
|
Consists of only one element (non-qualified namespaces) |
|
|
Consists of multiple elements |
|
|
application/xml and text/xml
The following table provides the samples of the REST request for the
application/xml and text/xml
content-type
application and the equivalent SOAP request after transformation from REST to
SOAP:
Request | Equivalent SOAP Request | |
---|---|---|
Consists of only one element and namespace added by the client |
|
|
Consists of only one element and client does not send the Namespace |
|
|
Consists of only one element and the client sends a different namespace to webMethods API Gateway |
|
|
Multiple XML elements |
|
|
Path and Query Parameters
The following table provides the samples of the REST request having path and query parameters and the equivalent SOAP request after transformation from REST to SOAP:
Request | Equivalent SOAP Request | |
---|---|---|
Simple query or path parameter |
or
|
|
Multiple query or path parameters |
or
or
|
|
Hierarchical elements |
|
|
multipart/form-data
If you send the
multipart/form-data
content-type as the REST
request, then you have to optimize the method to be used. This optimization is
based on the value specified in the
SOAP Optimization Method parameter available in
Routing policy. The default optimization type is Message Transmission
Optimization Mechanism (MTOM). For example,
webMethods API Gateway
converts REST requests with
multipart/form-data
and
multipart/mixed
types as follows:
- The Multipurpose
Internet Mail Extensions (MIME) parts that have a content ID or name that match
the elements of type
base64Binary
orhexBinary
in the schema are added as attachments to the outbound request. - Parts other than the
content ID or name types are converted into XML depending on the content-type
of the MIME part. The
application/xml
andapplication/json
content-types are converted. If webMethods API Gateway is unable to process the MIME part, it wraps the MIME part inside an XML element with the name of the content ID.