Providing SOAP Web Services in Document Mode
Learn how to provide SOAP web services in Document mode with the X4 BPMS.
Prerequisites:
- Basic knowledge of the structure of SOAP web services in Document style, in which the Request/Response Body is described completely via an XML Schema (XSD).
- A Technical Process per web service operation, which assumes the processing of the incoming request. The Technical Process is referenced via its
x4db:/ URL
, thereby. - A URL part, under which the SOAP web service shall be accessible via HTTP, e.g.
http://localhost:8080/X4/httpstarter/ReST/MyDocumentWebservice
. Normally, you have already defined this URL part as constant within the webservices configuration, see Graphically Editing the Web Service Configuration.
In order to provide a Technical Process as SOAP web service in Document mode, proceed as follows:
Create a new
SOAP
service entry under the desired URL resource (defined e.g. by means of a constant URL part) via the context menu Add SOAP Service.Specify the SOAP version (either SOAP 1.1, SOAP 1.2 or support for both standards).
Select the WSDL mode in WSDL Mode and the target prefix in Service Prefix.
Define the following configuration for each operation:
- Specify a valid name for the operation.
SOAP web services in Document mode require explicit Localnames for the operations.
Specify the namespace declaration for the data within the Request/Response body.
Link the Technical Process which handles the web service request using its
x4db:/ URL
.Within the Webservice Configuration Editor this is possible by drag & drop from the Repository Navigator.
Define the input handler and output handler for the SOAP web service.
Example: Define theSOAP-Content
to use the first element within thesoap:Body
as input and to create asoap:Body
and asoap:Envelope
element for the output.Specify the expected input XML data structure including the namespace within the element
<Input>
.Specify the output data structure to be generated including the namespace within the element
<Output>
.
- Specify a valid name for the operation.
- Save and apply the web service configuration with Reload on Server.
The SOAP web service in Document mode will be active instantly.
Generated WSDL Definitions in Document Mode
The automatically generated corresponding WSDL definition uses the DOCUMENT mode and is output in case of an HTTP GET
call of the SOAP web service URL.
For the WSDL mode DOCUMENT
, the X4 Server generates a WSDL definition from the service configuration. The WSDL definition is created as follows:
- For each namespace element with an attribute
schemaLocation
anxsd:schema
withxsd:include
for theschemaLocation
will be generated underwsdl:types
. - For each operation a
wsdl:message
will be generated whose name corresponds to the Localname of the configured operation. For eachInput
part a correspondingwsdl:part
will be generated within this message. - For each operation a
wsdl:message
will be generated whose name corresponds to the Localname of the configured operation, supplemented byResponse
. For eachOutput
part a correspondingwsdl:part
will be generated within this message. - For each operation a
wsdl:operation
and thus awsdl:portTyp
will be generated. The name of thewsdl:operation
is the Localname of the configured operation. The above generated messages are used as input/output message. - Depending on the SOAP version, corresponding
wsdl:binding
s are generated (exclusivelyliteral
bindings). An empty SOAP action is defined at all times.
Example: Configuration of a SOAP web service in Document mode
<Service type="Soap">
<SoapVersion>
<SOAP11/>
<SOAP12/>
</SoapVersion>
<Wsdl name="NameOfTheDocumentService" targetPrefix="service" mode="DOCUMENT"/>
<Namespace prefix="service" namespace="http://example.org/serviceSpace"/>
<Namespace prefix="exampleSpace" namespace="http://example.org/namespace"
schemaLocation="http://localhost:8080/X4/httpstarter/ReST/soapService/xsd/namespace.xsd"/>
<Namespace prefix="anotherSpace" namespace="http://example.org/different/namespace"
schemaLocation="http://localhost:8080/X4/httpstarter/ReST/soapService/xsd/differentNamespace.xsd"/>
<!-- DOCUMENT requires unique localnames for the operations -->
<Operation name="irrelevantName1"
process="x4db:/1/RestExamples/soap/DirectOutput.wrf">
<InputHandler type="SOAP-Envelope"/>
<OutputHandler type="SOAP-Envelope"/>
<Input>
<Part name="firstPart" element="exampleSpace:SpacedOperation"/>
</Input>
<Output>
<Part name="firstPart" element="exampleSpace:Operation1"/>
</Output>
</Operation>
<Operation name="irrelevantName2"
process="x4db:/1/RestExamples/soap/DirectOutput.wrf">
<InputHandler type="SOAP-Envelope"/>
<OutputHandler type="SOAP-Envelope"/>
<Input>
<Part name="firstPart" element="anotherSpace:SpacedOperation"/>
</Input>
<Output>
<Part name="Output" element="anotherSpace:SpacedOperation"/>
</Output>
</Operation>
<Operation name="irrelevantName3"
process="x4db:/1/RestExamples/soap/DirectOutput.wrf">
<InputHandler type="SOAP-Envelope"/>
<OutputHandler type="SOAP-Envelope"/>
<Input>
<Part name="UnSpacedOperation" type="xsd:integer"/>
</Input>
<Output>
<Part name="Value" type="xsd:String"/>
</Output>
</Operation>
</Service>