Rewriting the SAP WSDL file
From the service configuration created in PI Directory or transaction soamanager, copy the WSDL url and open it in the browser. As Metro requires the policy information, the WSDL must be rewritten to Policy 1.5 by using an XSLT as described below. XSLT is a generic approach of extracting XML data and rewriting XML documents. An XSLT transformation can be called in different ways. Below you find examples how to invoke it from XSML Spy, a Java application or an ABAP application.
Please ensure only one binding is included in the WSDL. When using soamanager, include a single endpoint in a service. Configuration created by PI Directory will allways include one binding per WSDL.
It is recommended to create WSDL files without import statements. This will avoid authentication issues as otherwise Metro will try to resolve the WSDL during runtime. Using the Url parameters, AS ABAP generates WSDLs with or without import statements. To generate a WSDL without import statments, use the URL containing the allinone directive:
Use the XSLT below for rewriting the WSDL.
1) The simple way: using XML Spy
A simple approachis to run the transformation in XMLSpy.
To rewrite the WSDL using XMLSpy:
- Download the WSDL and save it as a file
- Open the WSDL file in XMLSpy and select menu XSL->XSL Transformation
- Use the XSLT below and save the result in a file
2) The Java way
To rewrite the WSDL using an Java program:
- Copy the file below into a Java IDE
- Copy the XSLT and save it as "p12-p15.xslt" in the same package
- Adopt the main method an specify:
- wsdl url
- username for WSDL access
- password for WSDL access
- Location to store the SAP-WSDL
- Location to store the rewritten WSDL
3) The ABAP way
The ABAP approach is to provide the WSDL by URL. To achive this, a HTTP handler is created that will take the following step to rewrite the WSDL.
- Create an CL_HTTP_CLIENT and read the read the WSDL from the same ABAP system using destination NONE
- Transform it using the XSLT transformation
- Write the transformed WSDL
This solution is implemented as an ICF node. First create a class implementing IF_HTTP_EXTENSION. Use the coding below for IF_HTTP_EXTENSION~HANDLE_REQUEST.
Implementation: XSLT transformation
Using transaction STRANS to create a new XSLT transformation object and add the XSLT above. To match the coding above, use name z_p12_p15 as transformation name.
Implementation: SICF node
Finally, create an ICF node using the ABAP class as handler.
To rewrite a WSDL, call the ICF handler by passing the wsdl-url as parameter url. The url will depend on the name of the created ICF node, i.e.
NetBeans is not able to handle WSDL files requiring authentication. There are multiple solutions to this:
- Download the WSDL and specify the file
- Add &sap-user=<username>&sap-password=<password> to the url
- Add a service user in the icf node and select service user authentication