WSDL creation/response

WSDL creation is almost entirely handled by a supplied XSLT style sheet. Again, let's look at the code.

 Write-WSDL.
   
    XML ENABLE ATTRIBUTES
    If Not XML-OK Go To Z.
   
    XML ENABLE ALL-OCCURRENCES
    If Not XML-OK Go To Z.
   
    XML SET XSL-PARAMETERS
       "SOAP_Address" Service-URI *> WSDL
       "SOAP_Action_Prefix" SOAP-Action-URI *> WSDL
       "Interface_Name" Service-Name *> WSDL
       "Method_Namespace" Method-Namespace-URI. *> all
    If Not XML-OK Go To Z End-If.

    XML EXPORT FILE
      SOAP-Request-Response *> data item to export from
      BIS-Exchange-File-Name *> exported document file name
      "SOAP-Request-Response" *> model data-name
      "cobol_to_wsdl.xsl" *> stylesheet for transform
    If Not XML-OK Go To Z End-If.
    Call "B$WriteResponse" Using
         BIS-Response-SessionComplete
         Giving BIS-Status
    If Not BIS-OK Go To Z End-If.

This paragraph exports the WSDL to the exchange file using the cobol_to_wsdl.xsl style sheet. This style sheet is somewhat special in that it uses the structure of the SOAP-Request-Response record area to derive much of the information for the WSDL. (More 'normal' exports are focused on exporting data within a structure, rather than the structure itself.) It is for that reason that attributes and all occurrences are enabled. Additional metadata values are passed to the style sheet as XSL parameters. Furthermore this style sheet depends on the previously described naming conventions properly to identify all the methods and their parameters. B$WriteResponse is then called to notify the request handler that the response is in the exchange file; the request handler will send the contents of the exchange file to the client.