uCosminexus Service Platform, Reception and Adapter Definition Guide
This subsection explains the illustrated contents of a business process used for explaining how to create a WSDL file.
The following figure shows a business process to be used as an example for creating the WSDL.
Figure 2-7 Business process to be used as an example for creating the WSDL
An example of message format used in the business process and shown in the Figure 8-4 is described below:
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema targetNamespace="http://www.example.org/request" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="Request1" type="xsd:string" /> </xsd:schema> |
<Request1>Sample request message</Request1> |
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema targetNamespace="http://www.example.org/response" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="Response1" type="xsd:boolean" /> </xsd:schema> |
<Response1>true</Response1> |
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.example.org/service"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:svc="http://www.example.org/service">
<xsd:element name="Fault1" type="svc:SampleData"/>
<xsd:complexType name="SampleData">
<xsd:sequence>
<xsd:element name="param1" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
|
<Fault1> <param1>123</param1> </Fault1> |
This subsection explains an example of creating WSDL that is appropriate to the business process described in 2.7.1 Example of a Business Process Used for Creating WSDLby assuming the use of SOAP1.1. For details on the conditions and precautions related to the WSDL format, see 2.7.1 Application Scopes of Service Components That Use Web Services and 2.7.3 Notes on creating WSDL of a user-defined reception.
The example for creating WSDL is assumed to be Sample_Reception.wsdl. An overview of Sample_Reception.wsdl is explained below:
Sample_Reception.wsdl, an example of creating WSDL, is explained below:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
targetNamespace="http://www.example.org/service"
xmlns:svc="http://www.example.org/service"
xmlns:req="http://www.example.org/request"
xmlns:res="http://www.example.org/response"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xsd:schema targetNamespace="http://www.example.org/request">
<xsd:element name="Request1" type="xsd:string" />
</xsd:schema>
<xsd:schema targetNamespace="http://www.example.org/response">
<xsd:element name="Response1" type="xsd:boolean" />
</xsd:schema>
<xsd:schema targetNamespace="http://www.example.org/service">
<xsd:element name="Fault1" type="svc:SampleData"/>
<xsd:complexType name="SampleData">
<xsd:sequence>
<xsd:element name="param1" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="ReqMsg1">
<wsdl:part element="req:Request1" name="reqParam"/>
</wsdl:message>
<wsdl:message name="ResMsg1">
<wsdl:part element="res:Response1" name="resParam"/>
</wsdl:message>
<wsdl:message name="FltMsg1">
<wsdl:part element="svc:Fault1" name="fltParam"/>
</wsdl:message>
<wsdl:portType name="SamplePortType">
<wsdl:operation name="operation1">
<wsdl:input message="svc:ReqMsg1"/>
<wsdl:output message="svc:ResMsg1"/>
<wsdl:fault message="svc:FltMsg1" name="Fault1"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SampleBinding" type="svc:SamplePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="operation1">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:body/>
</wsdl:input>
<wsdl:output>
<soap:body/>
</wsdl:output>
<wsdl:fault name="Fault1">
<soap:fault name="Fault1"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SampleService">
<wsdl:port binding="svc:SampleBinding" name="UserInfo">
<soap:address location="http://localhost:80/SampleService/services/UserInfo" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
|
This example Sample_Reception.wsdl is created as per the operations explained below from (1) to (8):
List the synchronous operations defined in the receive activity and reply activity of a business process. If a reply activity exists in which the fault name is defined, list the fault names as well.
In the creation example, the operation corresponds to operation1. Also, the fault name corresponds to Fault1.
List message format definition files for the allocated variables used in the receive activity and reply activity.
In the creation example, the files correspond to Request.xsd, Response.xsd, and Fault.xsd.
Define an XML declaration and the wsdl:definitions element as the template for a WSDL file. In the wsdl:definitions element, add the attributes described in the following table.
Table 2-22 Attributes to be added in the wsdl:definitions element
| Attributes | Meaning | Value | Number |
|---|---|---|---|
| targetNamespace | Name space URI of the service component | You can define any URI. However, if a fault message exists, define URI same as the value of targetNamespace attribute that exists in the xsd:schema element of the message format definition file for the fault message. | 1 |
| xmlns:svc | Prefix declaration of a service component | Define the value specified in the targetNamespace attribute. | 1 |
| xmlns:req | Message format prefix declaration of a request message | Define URI same as the value of targetNamespace attribute that exists in the xsd:schema element of the message format definition file for the request message. | 1 |
| xmlns:res | Message format prefix declaration for a response message | Define URI same as the value of targetNamespace attribute that exists in the xsd:schema element of the message format definition file for the response message. | 1 |
| xmlns:soap | Prefix declaration of SOAP | Define the pre-defined value http://schemas.xmlsoap.org/wsdl/soap/. | 1 |
| xmlns:wsdl | Prefix declaration of WSDL | Define the pre-defined value http://schemas.xmlsoap.org/wsdl/ | 1 |
| xmlns:xsd | Prefix declaration of XML schema | Define the pre-defined value http://www.w3.org/2001/XMLSchema. | 1 |
The following figure shows an example for defining the wsdl:definitions element:
Figure 2-8 Definition example of the wsdl:definitions element
Table 2-23 Attribute to be added in the wsdl:definitions element (when multiple operations are used)
| Attributes | Meaning | Value |
|---|---|---|
| xmlns:reqN(N>0) | Prefix declaration used when the request messages are divided into multiple name spaces | Define URI same as the value of targetNamespace attribute that exists in the xsd:schema element of the message format definition file for the request message.
|
| xmlns:resN(N>0) | Prefix declaration used when the response messages are divided into multiple name spaces | Define URI same as the value of targetNamespace attribute that exists in the xsd:schema element of the message format definition file for the response message.
|
Figure 2-9 Definition example of the wsdl:definitions element (When multiple operations are used)
Define the wsdl:types element, its lower elements, and attributes.
The following table describes the elements and attributes to be defined in the wsdl:types element:
Table 2-24 Elements and attributes to be defined in the wsdl:types element
| Element | Attributes | Meaning | Value | Number | ||
|---|---|---|---|---|---|---|
| wsdl:types | -- | Type definition element | -- | 1 | ||
| xsd:schema | -- | Schema element | -- | From 1 up to the number of name spaces used in the message format definition file | ||
| targetNamespace | Name space attribute | Define the value same as the targetNamespace of the message. | 1 | |||
| Attribute of xsd:schema | Attributes | Define the value same as the message attribute. | From 1 up to the number of attributes | |||
| Child element of xsd:schema | -- | Message contents | Copy all the child elements of the xsd:schema element that the message contains. | From 1 up to the number of child elements of the xsd:schema element in the message formats using the same name space | ||
The following figure shows an example for defining the wsdl:types element:
Figure 2-10 Definition example of the wsdl:types element
Define the wsdl:message element, its lower elements and attributes:
The following table describes the elements and attributes to be defined in the wsdl:message element:
Table 2-25 Elements and attributes to be defined under the wsdl:message element
| Element | Attributes | Meaning | Value | Number | |
|---|---|---|---|---|---|
| wsdl:message | -- | Message definition element | -- | 1 | |
| name | Message name attribute | Define a unique string different from the name attribute of other wsdl:message elements. | 1 | ||
| wsdl:part | -- | Message part definition element | -- | 1 | |
| name | Message part name attribute | Define any string#. | 1 | ||
| element | Element reference attribute | Define the root element of applicable message format file. | 1 | ||
The following figure shows an example for defining the wsdl:message element:
Figure 2-11 Definition example of the wsdl:message element
Define the wsdl:portType element, its lower elements, and attributes.
The following table describes the elements and attributes to be defined in the wsdl:portType element:
Table 2-26 Elements and attributes to be defined in the wsdl:portType element
| Element | Attributes | Meaning | Value | Number | ||
|---|---|---|---|---|---|---|
| wsdl:portType | -- | Port type definition element | -- | 1 | ||
| name | Port type name attribute | Define any string#. | 1 | |||
| wsdl:operation | -- | Operation definition element | -- | From 1 up to number of operations | ||
| name | Operation name attribute | Define the operation name. | 1 | |||
| wsdl:input | -- | Request message definition element | -- | 1 | ||
| Message | Message reference attribute | Specify the name attribute value of the wsdl:message element defined in (e) Defining the wsdl:message element with QName. | 1 | |||
| wsdl:output | -- | Response message definition element | -- | 1 | ||
| Message | Message reference attribute | Specify the name attribute value of the wsdl:message element defined in (e) Defining the wsdl:message element with QName. | 1 | |||
| wsdl:fault | -- | Fault message definition element | -- | From 1 up to number of faults | ||
| name | Fault message name attribute | Define fault name. | 1 | |||
| Message | Fault message reference attribute | Specify the name attribute value of the wsdl:message element defined in (e) Defining the wsdl:message element with QName. | 1 | |||
The following figure shows an example for defining the wsdl:portType element:
Figure 2-12 Definition example of the wsdl:portType element
Define the wsdl:binding element, its lower elements, and attributes.
The following table describes the elements and attributes to be defined in the wsdl:binding element:
Table 2-27 Elements and attributes to be defined in the wsdl:binding element
| Element | Attributes | Meaning | Value | Number | |||
|---|---|---|---|---|---|---|---|
| wsdl:binding | -- | Binding definition element | -- | 1 | |||
| name | Binding name attribute | Define any string#. | 1 | ||||
| type | Port type reference attribute | Specify the name attribute value of wsdl:portType defined in (f) Defining the wsdl:portType element in QName. | 1 | ||||
| soap:binding | -- | SOAP binding definition element | -- | 1 | |||
| transport | SOAP binding transmission type definition attribute | Define http://schemas.xmlsoap.org/soap/http (fixed value). | 1 | ||||
| wsdl:operation | -- | Operation definition element | -- | From 1 up to number of operations | |||
| name | Operation name attribute | Define the operation name. Specify the value same as the name attribute value of the wsdl:fault element that is a child element of the wsdl:operation element defined in (f) Defining the wsdl:portType element. |
1 | ||||
| soap:operation | -- | SOAP binding operation definition element | -- | 1 | |||
| soapAction | SOAPAction header definition attribute | -- | 1 | ||||
| wsdl:input | -- | Request message definition element | -- | 1 | |||
| soap:body | -- | SOAP binding Body element definition element | -- | 1 | |||
| wsdl:output | -- | Response message definition element | -- | 1 | |||
| soap:body | -- | SOAP binding Body element definition element | -- | 1 | |||
| wsdl:fault | -- | Fault message definition element | -- | From 1 up to number of faults | |||
| name | Fault message name attribute | Define fault name. | 1 | ||||
| soap:fault | -- | SOAP binding Fault element definition element | -- | 1 | |||
| name | SOAP binding name attribute | Define fault name. | 1 | ||||
The following figure shows an example for defining the wsdl:binding element:
Figure 2-13 Definition example of the wsdl:binding element
Figure 2-14 Definition example of the wsdl:binding element (When the style attribute and use attribute are used)
Define the wsdl:service element, its lower elements, and attributes.
The following table describes the elements and attributes to be defined in the wsdl:service element:
Table 2-28 Elements and attributes to be defined under the wsdl:service element
| Element | Attributes | Meaning | Value | Number | ||
|---|---|---|---|---|---|---|
| wsdl:service | -- | Service definition element | -- | 1 | ||
| name | Service name attribute | Define any string#. | 1 | |||
| wsdl:port | -- | Port definition element | -- | 1 | ||
| name | Port name attribute | Define any string#. | 1 | |||
| binding | Binding reference attribute | Specify the name attribute value of the wsdl:binding element defined in (g) Defining the wsdl:binding element with QName. | 1 | |||
| soap:address | -- | SOAP binding address definition element | -- | 1 | ||
| location | Service location definition attribute | As a temporary value, define http://localhost:80/SampleService/services/PortName. Specify a value same as the name attribute of the wsdl:port element in PortName. |
1 | |||
The following figure shows an example for defining the wsdl:service element:
Figure 2-15 Definition example of the wsdl:service element
Figure 2-16 Definition example of the wsdl:service element (When multiple wsdl:port elements are used)
All Rights Reserved. Copyright (C) 2015, Hitachi, Ltd.