Providing SOAP Web Services in RPC-Style
Prerequisites:
- Basic knowledge of the structure of SOAP web services in RPC style
- 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/MyRPCWebservice
. Normally, you have already defined this URL part as constant within the webservice configuration.
In order to deploy a Technical Process as SOAP web service in RPC style, 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 RPC style require explicit Localnames for the operations.
Link the Technical Process which handles the web service request via the X4 Server using its
x4db:/ URL
.Within the Webservice Configuration Editor this is possible via drag & drop from the Repository Navigator.
Define the input 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 within the element
<Input>
, optionally with XML schema definition.Specify the output data structure to be generated 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 RPC style will be active instantly.
Generated WSDL Definitions in RPC
The automatically generated corresponding WSDL definition uses the RPC
style and is output in case of an HTTP GET
call of the SOAP web service URI.
For the WSDL mode RPC
, 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. In case of SOAP web services with RPC style, for each operation atargetNamespace
is declared, if the operation name is a Qualifiedname (i.e. a name with colon).
Example: Configuration of a SOAP web service in RPC mode
<Service type="Soap">
<SoapVersion>
<SOAP11/>
<SOAP12/>
</SoapVersion>
<Wsdl name="NameOfTheRpcService" targetPrefix="service" mode="RPC"/>
<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"/>
<!-- RPC requires unique localnames for the operations -->
<Operation name="exampleSpace:RpcOp1"
process="x4db:/1/RestExamples/soap/DirectOutput.wrf">
<InputHandler type="SOAP-Envelope"/>
<OutputHandler type="SOAP-Envelope"/>
<Input>
<Part name="firstPart" element="exampleSpace:Operation1"/>
</Input>
<Output>
<Part name="firstPart" element="exampleSpace:Operation1"/>
</Output>
</Operation>
<Operation name="anotherSpace:RpcOp2"
process="x4db:/1/RestExamples/soap/DirectOutput.wrf">
<InputHandler type="SOAP-Envelope"/>
<OutputHandler type="SOAP-Envelope"/>
<Input>
<Part name="firstPart" type="anotherSpace:SomeType"/>
</Input>
<Output>
<Part name="Output" type="anotherSpace:SomeType"/>
</Output>
</Operation>
<Operation name="RpcOp3"
process="x4db:/1/RestExamples/soap/DirectOutput.wrf">
<InputHandler type="SOAP-Envelope"/>
<OutputHandler type="SOAP-Envelope"/>
<Input>
<Part name="Value" type="xsd:integer"/>
</Input>
<Output>
<Part name="Value" type="xsd:String"/>
</Output>
</Operation>
</Service>