With the version 1.5.4 B1if provides the Web Service Atom. It allows you to create a web service call in the processing flow just based on its WSDL.
The Web Services Description Language (WSDL, pronounced ‘wiz-del’) is an XML-based language that provides a model for describing Web services. It is a standardized interface definition for a Web service and describes the complete connectivity, e.g. the URL to call, it describes the ports and methods, provided by the Web service. It also provides the schema definitions for the request and the response document by XSD schemas (XML Schema Definition).
The idea is that the Web service provider hands over the WSDL to the Web service consumer. No longer big questions and discussions about the interface as the WSDL gives you all information you need. Although the WSDL contains all information, in reality you need to understand the complex structure of a WSDL and XSD if you want to create the Web service call out of the WSDL definition.
The B1if Web Service Atom is interpreting the WSDL for you. You do not need to understand WSDL and XSD. Let’s assume as a sample, a friend sent you a link to a WSDL, describing an interesting Web service, available via internet free of charge. A sample could be the URL:
By calling this url you will load the WSDL for a Web service that allows you to get detailed bank information for all German banks by sending a bank code (BLZ = Bankleitzahl). If you input this URL into the browser you will see the WSDL, displayed in your browser. But how to use this in B1if?
Let’s create a small sample scenario. When you click the [Processing] button in the screen ‘Scenario Step Definiton’, the graphical flow designer will display the automatically created flow, consisting out of the one final atom. Click on the ‘Add Atom’ icon on the start atom and add the atom ‘Call Web Service’. The atom ‘soapCall’ will be created (atom1) and automatically a predecessor transformation atom ‘xform’ (atom2).
Now click the edit icon (pencil) of the soapCall atom and click the [Load] button in the opening screen. A small selection box asks you to select the location from where you want to load the WSDL. This can be the File System, the Bizstore (B1i internal xml persistency) or the Web. We select the option ‘Load from Web’, the input screen opens, we type in the URL and click the [Submit!] button. Immediately the WSDL is loaded from the web and stored in the base directory of the Scenario Step.
Now we can click the [Generate] button in the edit screen. The generator is interpreting the WSDL. In case there are multiple ports, it pops up a selection box to allow you to select the one you want. In case there are multiple methods defined for the selected port, it pops up a selection box to allow you to select the one you want. In our example we choose the port ‘BLZServiceSOAP11port_http’. As only one method is available for this port no more selection box will pop up and all the connect information and the request document is generated automatically into the XSL document, assigned to the predecessor transformation atom. For a first run we need to open this XSL (atom2.xsl) via WEBDAV in a separate XML editor or just by clicking on the xform atom in case you are working with an embedded XML editor.
You’ll see all the connection parameters and the request document sample, generated automatically based on the schema information in the WSDL.
There are multiple options in the XSD part of the WSDL to describe the schema of the request document. It allows to specify e.g. min/max occurrences, enumeration, value type, exact pattern for a value, etc. The B1if generator is using all available information to describe how to provide the request document for this call, however the detailed information in the WSDL is optional and it’s up to the Web service provider to fill all details in the WSDL. In our example we’ll find the request document, requesting the one parameter <blz>. In the body the generator created the type information ‘string’, which is one of the detailed information provided by the WSDL. We just replace ‘string’ with a valid BLZ, e.g. ‘69070032’ and save the changes.
Now the Scenario Step to call the Web service is ready. Open the test environment by clicking the [Test] button and then click [Run]. Now the step is processed and you can open the graphical flow in debug mode by clicking the [Debug] icon. A window opens to display the debug flow. In the flow after the soapCall atom, we will find the service response in the message. Just click on the red arrow of the final atom.
This was a sample to demonstrate how to call any Web service within a B1if processing flow. For productive usage the BLZ is for sure not hardcoded in the xsl, but is e.g. picked up by <xsl:value of select=””/> or a variable.
In case you want to provide Web services to externals, you have to provide a WSDL to the service consumers. Also here you can do this without XSD and WSDL knowledge. The needed functionality is available via Scenarios->Setup->Tools. As all connect information will be needed to generate the WSDL, prerequisite is to setup and activate the Scenario Package first. There will be one WSDL file for each Scenario Package. Each Scenario Step, linked to this package which is of input type ‘Web Service’ will be a method in this WSDL.
As the XSD schemas for the request and response documents are part of the WSDL, the first step is to provide the XSD schemas for all Scenario Steps that you want to expose. You can do this manually or by generation based on sample inbound and outbound documents. You can put a sample inbound/outbound document manually into the base folder of the Scenario Step or you can use B1if to generate the test messages automatically (Maintenance->Cfg Dev Environment: check ‘Record test msg during processing’).
In case the XSD generator will not find a test message in the base folder, it will use as a fallback the last message of the Message Log. For this option you have to run each Scenario Step at least once so that for each step a Message Log entry will be available.
Once the XSD files are available, be it generated or manually, you can generate the complete WSDL. The WSDL generator will generate methods for all Scenario Steps, defined as Web services and with existing XSD schemas in their base folder. The WSDL will be displayed in your browser. You can store it in your File System and send it to the 3rd party system that wants to use your Web services.