Release 10.1A: OpenEdge Development:
Web Services

> ## 4GL procedure prototype to WSDL operation (Web service development)

> This is the Progress procedure prototype for the sample `FindCustomerByNum.p` external procedure:

> Progress 4GL procedure prototype
>     /* FindCustomerByNum.p */
>     DEFINE INPUT PARAMETER CustomerNumber AS INTEGER.
>     DEFINE OUTPUT PARAMETER CustomerName AS CHARACTER.

> For ProxyGen, the main information mapped from this prototype into the corresponding Web service operation definition is in bold, including the procedure name (filename for an external procedure) and for any parameters, the parameter mode (input or output), names, and data types.

> Note: Some information can only be specified in ProxyGen, such as whether the 4GL `RETURN-VALUE` is used and (for external procedures) what Open Client object this operation belongs to.

> These are the `message` section definitions in the RPC/Encoded and RPC/Literal WSDL file for the `FindCustomerByNum` operation request and response messages:

> WSDL message section defining request and response messages
>       <message name="OrderInfo_FindCustomerByNum">
>         <part name="CustomerNumber" type="xsd:int"/>
>       </message>
>       <message name="OrderInfo_FindCustomerByNumResponse">
>         <part name="CustomerName" type="xsd:string"/>
>       </message>

> Note that the request message contains the input parameter, `CustomerNumber`, and the response message contains the output parameter, `CustomerName`, both defined by appropriate XML data types.

> This is the definition for the `FindCustomerByNum` operation in the `portType` section of the WSDL:

> WSDL portType section defining an operation signature on an object
>       <portType name="OrderInfoObj">
>         <operation name="FindCustomerByNum"
>                parameterOrder="CustomerNumber CustomerName">
>           <input message="tns:OrderInfo_FindCustomerByNum"/>
>           <output message="tns:OrderInfo_FindCustomerByNumResponse"/>
>           <fault name="OrderInfoFault" message="tns:FaultDetailMessage"/>
>         </operation>
>         ...
>       </portType>

> The `portType` section defines the object in which the operation is defined, in this case, the AppObject, `OrderInfo` (as specified in ProxyGen). Note that this definition groups together the request (input) and response (output) messages, along with a generic fault message as part of the operation definition.

> This is the definition for the `FindCustomerByNum` operation in the Bindings section for the AppObject, `OrderInfo`:

> WSDL Bindings section defining an operation and object binding
>       <binding name="OrderInfoObj" type="tns:OrderInfoObj">
>         <soap:binding style="rpc"
>             transport="http://schemas.xmlsoap.org/soap/http"/>
>         <operation name="FindCustomerByNum">
>           <soap:operation soapAction="" style="rpc"/>
>           <input>
>             <soap:header message="tns:OrderInfoID" part="OrderInfoID"
>                 use="encoded"
>                 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>                 namespace="urn:OrderSvc:OrderInfo" wsdl:required="true">
>             </soap:header>
>             <soap:body use="encoded"
>                encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>                namespace="urn:OrderSvc:OrderInfo"/>
>           </input>
>           <output>
>             <soap:body use="encoded"
>                 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>                 namespace="urn:OrderSvc:OrderInfo"/>
>           </output>
>           <fault name="OrderInfoFault">
>             <soap:fault name="OrderInfoFault" use="encoded"
>                 encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>                 namespace="http://servicehost:80/wsa/wsa1"/>
>           </fault>
>         </operation>
>         ...
>       </binding>

> Note that this definition specifies that the transport protocol as SOAP over HTTP, and goes on to define the content for SOAP messages request (input) and response (output) messages for the operation. This is where the object ID definitions are referenced for operations that require them.

> This is the port definition in the `service` section for the object (`OrderInfo` AppObject) containing the `FindCustomerByNum` operation:

> WSDL service section defining the Web service location
>       <service name="OrderInfoService">
>         <port name="OrderInfoObj" binding="tns:OrderInfoObj">
>           <documentation/>
>           <soap:address location="http://servicehost:80/wsa/wsa1"/>
>         </port>
>         ...
>       </service>

> Note that the URL for the WSA instance is specified here for the location of the Web service.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095