Share via


5     Ping/Echo Scenarios

The PO/Confirmation scenario describes general steps that have to be performed end-to-end to set up Web services standards-based connectivity. If you want to set up other scenarios, using different security settings for example or you are looking for additional information about scenarios that are not interoperable, refer to the detailed descriptions provided in the following sections. They contain additional information about special settings and refer to the Ping/Echo scenarios that were used for testing between Microsoft and SAP.

The first two sections describe what you must do to test specific Ping/Echo scenarios. In the following sections, this chapter provides additional information about security settings, reliability, data types, Message Transmission Optimization Mechanism (MTOM), WS-Addressing and the different WSDL document styles.

The WCF test suite includes code for a number of feature areas and scenarios. Feature areas are collections of scenarios and each scenario is typically linked to a particular protocol. You can find the code for these scenarios in the C:\test\wcf\src\suite\XwsInterop folder. Feature areas generally correspond to a folder within the XwsInterop folder and most of them have a Visual Studio solution file associated with them, which makes navigation easier. Implementations of some of these scenarios are shipped with SAP NetWeaver Application Server.

Note   Code for some of the scenarios is separated from its associated feature areas. If the references to the following scenarios are incomplete, search in the Common folders in the solution.

You can use the Svcutil.exe utility or Visual Studio to create a .NET Framework 4 client that interoperates with aparticular SAP service. The ContractOverrides.cs file included in the .NET Framework 4 implementation in the test suite is generally useful to help you create a .NET Framework 4 client, also.

Note   If you use Visual Studio to create a client, add the service reference by right-clicking the project file in Solution Explorer and then clicking Add Service Reference.

The tests included in this section are examples of .NET Framework 4 configurations that are verified to work in the SAP/WCF interoperability environment.

Note   Some of the test cases listed in this section are not interoperable with the SAP NetWeaver Application Server and you should avoid using them. These scenarios are called out in the section that describes them and Figure 17.

 

Scenario Section Interoperable between NetWeaver Application Server ABAP and .NET Framework
Using Authentication with UsernameToken (WSS Usernametoken) 5.3.2 Yes
Using Authentication with X.509 Certificate on Message Level 5.3.3 Yes
Using Authentication with Issued Token for Single Sign-On 5.3.4 Yes (2 scenarios)
Further Combinations 5.3.5 Only with SAP consumers
One-way Reliable Messaging 5.4.1 and 5.4.2 Yes
Request-response Reliable Messaging 5.4.3 and 5.4.4 No
Idempotent Service Handling 5.4.5 Not tested
Base Data Type Testing 5.5.1 Yes
Complex Data Type Testing 5.5.2 Yes
Message Transmission Optimization Mechanism (MTOM) 5.6 Yes (2 scenarios)
WS-Addressing 5.7 2 scenarios, 1 yes
Requests and Responses that Contain Application-Defined Headers 5.8.3 Only with SAP consumers
Request with Empty Body Element 5.8.4 No

Figure 17 Ping/Echo scenarios listing

5.1    Testing Procedure Template: Microsoft

Use the following procedure as a template to test particular interoperability scenarios between WCF and the SAP NetWeaver application. To use the procedure for other features and scenarios, replace Security.WsSecurity with the feature you want to test and replace UserNameOverTransport with the scenario you want to test.

To test interoperability scenarios between Microsoft and SAP

  1. Click Start, click All Programs, and then click Internet Explorer.
  2. In the address bar, type http://NETServer/endpoints, and then press ENTER.
  3. In the Feature drop-down list, select Security.WsSecurity, and then click Click here to invoke WCF client for Security.WsSecurity.
  4. Click the new tab, and then expand the UserNameOverTransport scenario.
  5. Update the Service Address box and WSDL URI box as appropriate for the SAP NetWeaver service endpoint.
  6. Select the UserNameOverTransport checkbox, and then click Test Selected Scenarios at the bottom of the page.
  7. On the results page, review the results of the test, which can either be Pass or Fail. Expand UserNameOverTransport to view detailed results.
  8. To see more details, you can expand Debug Log, Request Messages, Response Messages, and any messages in the request and response messages lists.

The following sections contain the names of feature areas and associated scenarios for you to test known working interoperability scenarios. All of the scenarios include:

  • The physical path to the source files for the feature area.
  • The URI for the WSDL associated with the scenario. Most, but not all, of these scenarios are WS-Policy implementations. The scenario descriptions also indicate whether the scenario implements WS-Policy. 
  • The physical path to the file that contains binding configuration for the scenario. In most cases this is a Web.config file, but in some cases the configuration is code-generated.
  • Other information is included in the descriptions on an as-required basis.

5.2    Testing Procedure Template: SAP

The PingEcho_Scenarios.xlsx Excel spreadsheet provides an overview of all Ping/Echo scenarios that SAP and Microsoft used for interoperability testing.

Download the Excel spreadsheet from the following location on SAP Developer NetWork (SDN): http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/301f7062-e043-2d10-cc9b-c3ecf63c50ac

The PingEcho_scenarios.xlsx Excel spreadsheet contains the following information:

  • Target Version: Indicates the SOAP version and determines which test template to use
  • Attachment: Indicates the test area
    • Attachment 1: Security test with WS Security, SecureConversation and WS-Trust
    • Attachment 2: WS-RM testing
    • Attachment 3: Data type and WSDL style tests
    • Attachment 4: MTOM and WS-Addressing tests
  • Client: Indicates the client in the scenario (MS,SAP)
  • Scenario: Scenario identifier
  • SAP Scenario Name
  • Microsoft Scenario Name
  • Name of the SAP consumer proxy
  • Name of the SAP service definition

With this file, you can find the implementation of the Ping/Echo scenarios in the AS ABAP and in the Microsoft project.

If SAP provides a service, you have to do the following to test a scenario:

  1. Select a scenario you want to look at from the PingEcho_scenarios.xlsx Excel spreadsheet and find the SAP service definition.
  2. Go to SOA Management (transaction SOAMANAGER), select the service and define an endpoint for the service.
    You can find the detailed settings for the endpoint in the following sections.
  3. To run the service from the .NET Framework side, you need the following information:
    • WSDL URL of the service
      To obtain the URL, in SOA Management (transaction SOAMANAGER), click the link Display selected Bindings or Service’s WSDL URL on the Overview tab and copy the link.
      Use the WSDL format WS_Policy. Additionally you can generate a WSDL for either SOAP 1.1 or SOAP 1.2.
      Some scenarios might require the document_wrapped WSDL document style. In the WSDL URL, replace document with document_wrapped.
    • Service URL
      Open the WSDL document of the service in a browser.
      Go to the bottom of the document and copy the link provided in the location attribute of the address element in the port section.

You need this information to access this service from .NET Framework side in the WCF Interop Endpoint Browser (http://NETServer/endpoints).

If SAP accesses a service, you have to do the following to test a scenario:

  1. Select a scenario you want to look at from the PingEcho_scenarios.xlsx Excel spreadsheet and find the SAP consumer proxy.
  2. In SOA Management (transaction SOAMANAGER), configure a logical port for this consumer proxy.
    Use the WSDL provided by Microsoft.
    You get the WSDL from the WCF Interop Endpoint Browser (http://NETServer/endpoints).
  3. In the Data Browser (transaction SE 16) type in Table Name SRT_BZT_CFG_P2P and select Create.
  4. Make an entry for the scenario you want to test.

    Figure 18 Input parameters for Ping/Echo testing

    1. In the CFG_VARIANT field, type in the SOAP version (SOAP11 or SOAP12).
      This corresponds with the target version in the PingEcho_scenarios.xlsx Excel spreadsheet.
    2. In the SCENARIO field, type in the name of the SAP scenario you want to test.
      Find the scenario name in the PingEcho_scenarios.xlsx Excel spreadsheet in column Scenario.
    3. Type SAP in the SCENARIO_CLIENT field.
    4. Type NET in the SCENARIO_ENDPOIN field.
    5. Type the name of the logical port you created in the LP field.

    Figure 19 Table SRT_BZT_CFG_P2P

  5. To run the scenario, call transaction SRT_BIZTALK_TEST2.
    The following user interface is displayed:

    Figure 20 Accessing a Ping/Echo scenario in AS ABAP

    1. Select Point-to-point.

      Do not select Mediated via PI, this option involves SAP NetWeaver Process Integration(PI). SAP NetWeaver PI is not in scope for this guide and the described scenarios cannot be used with a PI system of version SAP NetWeaver 7.0, EHP 2. This option will be made available with the next version of SAP NetWeaver PI.

    2. Click the Target version you want to use.
      Depending on the target version, a list is displayed:

Figure 21 Selecting a Ping/Echo Scenario

  1. Select the scenario you want to test. You can find the scenario name in the SAP Scenario Name column in the PingEcho_scenarios.xlsx Excel spreadsheet.
    The Test values section is not relevant.
  2. Select Execute.
    The test result is displayed and you can select Display more Details to find further information.

Figure 22 Selecting a Ping/Echo scenario

In the following sections, you find information about the service definition and consumer proxy required to execute the tests.

5.3    SecurityConfigurations

You can use the following security features for scenarios between .NET Framework 4 and AS ABAP.

Authentication options:

  • Authentication with UsernameToken.
  • Authentication with X.509 certificate at the message level.
  • Authentication with issued token for Single Sign-On obtained by a security token service (STS).

For secure communication between consumer and provider.

  • Using SSL for protection at the transport level.
    This option is already described in the preceding PO/Confirmation scenarios.
  • Using WS-Security for protection at the message level.

5.3.1      Handling Certificates for Encryption and Authentication in AS ABAP

For (signature) and authentication with certificates encryption, the following additional certificates are required.

  1. Find the certificates in C:\binaries.x86chk\CDF\Test\wcf\Suite\XwsInterop\scripts\deploy after unzipping the Ping/Echo suite downloaded from https://code.msdn.microsoft.com/WCFInterop.
  2. Save the certificates to your file system.
  3. In AS ABAP, go to Trust Manager (transaction STRUST).
  4. Use dfault(Alice).pse for signature and for authentication with certificate, use wsskey(Bob).pse for encryption.
  5. Import Bob:
    1. From the menu select PSE and Import and select the file for Bob.
    2. From the menu select PSE and Save as… and WS Security.
    3. In the DFAULT field select WSSKEY and  (Enter).
  6. Import Alice:
    1. From the menu select PSE and Import and select the file for Alice.
    2. From the menu select PSE and Save as… and WS Security.
    3. In the DFAULT field select DFAULT and  (Enter).
    4. Type a record in table USREXTID to map the certificate to the SAP technical user that is used for the Web service call. Use for example, the table maintenance transaction SM30, view VUSREXTID.

Note…Do not use these certificates in production scenarios. Refer to the following description to import certificates for production scenarios.

To manage certificates in AS ABAP Trust Manager for encryption

  1. In AS ABAP, go to Trust Manager (transaction STRUST).
  2. If AS ABAP is the provider, export the public key certificate that the consumer should use for encryption from the WS-Security PSE WS Security Keys to a file and hand it over to the consumer.
    Double click on WS Security WS Security Keys and select  (Export certificate).
  3. If AS ABAP is the consumer, import the encryption certificate received from the provider into the WS Security PSE Other System Encryption Certs.
    Double click on WS Security Other System Encryption and select  (Import certificate.)

To manage certificates in AS ABAP Trust Manager for authentication on message level (and signature)

  1. If AS ABAP is the provider, agree with the service consumer on a CA certificate and import it into WS-Security PSE WS Security Keys.
  2. Type a record in table USREXTID to map the certificate to the SAP technical user that is used for the Web service call. Use for example, the table maintenance transaction SM30, view VUSREXTID.
    More information: Maintaining the User Mapping for Incoming Connections that Use Authentication

More information: Trust Manager

5.3.2      Using Authentication with UsernameToken (WSS Usernametoken)

UsernameToken is a security token defined in the WS Security standard to transport the user ID and password in a SOAP message.  

A SOAP:Envelope/SOAP:Header/wsse:Security/wsse:Username element is added to the message, which contains a timestamp, a user ID and a password.

For communication security, use either HTTP over SSL or secure the message by symmetric encryption.

Enabling HTTP over SSL is already described in the Setting up Security and Trustsection.

5.3.2.1      Settings in AS ABAP Provider

For performance reasons, using WS-SecureConversation is recommended whenever multiple messages require identical security in a relatively short period. WS-SecureConversation involves some set up overhead but avoids repeated X.509 operations. This particular scenario, however, involves only one message and therefore does not use WS-SecureConversation.

In AS ABAP, provide an endpoint to a service in SOA Management (transaction SOAMANAGER):

On the Provider Security tab, select the following:

Figure 23 Provider security settings for symmetric message encryption and user ID/password authentication

Provide the user ID and password to the consumer.

5.3.2.2      Settings in AS ABAP Consumer

In SOA Management (transaction SOAMANAGER), on the Service Administration tab page, choose the Single Service Configuration link.

  1. Find the consumer proxy to access the service endpoint and for which you want to define a logical port.
  2. Select the consumer proxy in the list of search results and choose Apply Selection.
  3. On the Configurations tab page, select the Create Log. Port button.
  4. Specify the following in the dialog box:
    1. The name of the logical port and its description.
    2. For configuration type, select the WSDL-Based Configuration button.
    3. Under WSDL access settings, select the Via HTTP Access radio button.
    4. Under WSDL location, type in the URL of WSDL.
    5. If required, provide the user ID and password for WSDL access.
    6. Select the endpoint.
    7. Select Apply Settings.
  5. In the User Name field, specify the user name, and in the Password field, type in the password of the user for authentication provided by the service provider.
  6. In the Certificate field, select the PSE.

Figure 24 Consumer security settings for symmetric message encryption and user ID/Password authentication

5.3.2.3      SAP Scenario Details

SAP Provider

  • Service Definition: IPingService

SAP Consumer

  • Consumer Proxy: CO_SRT_IPING_SERVICE_OUT

5.3.2.4      Microsoft Scenario Details

  • Microsoft name: Username over Certificate
  • Feature area: Security.WsSecurity
  • Scenario: UXD_Addressing10 (which means Username over Certificate with derived keys and WS-Addressing 1.0)
  • Source folder: C:\test\wcf\src\suite\XwsInterop\Security\WsSecurity
  • The specific WS-Policy of interest is UXD_Addressing10_IPingService_policy in http://NETServer/Security_WsSecurity_Service_Indigo/WsSecurity11.svc?wsdl=wsdl0
  • Specific configuration binding: UXD_Addressing10 in the C:\test\wcf\src\suite\XwsInterop\Security\WsSecurity\service\indigo\Web.Config file.

5.3.3      Using Authentication with X.509 Certificate on Message Level

Instead of providing a user ID and password, consumers can authenticate themselves using an X.509 certificate token on message level. Message transport is secured by using symmetric encryption. Optionally you can enable WS-SecureConversation. See the Authentication with UsernameToken (WSS Usernametoken) section for more information about WS-SecureConversation.

5.3.3.1      AS ABAP Provides a Service

Select the following options in transaction SOAMANAGER on the Provider Security tab.

Figure 25 Provider security symmetric encryption and X.509 authentication on message level

5.3.3.2      AS ABAP Consumes a Service

In transaction SOAMANAGER, type in:

  • In the Encryption Certificate field, select the PSE for encryption.
  • In the X.509 Certificate field, select the PSE for authentication.

5.3.3.3      SAP Scenario Details

SAP Provider

  • Service Definition: IPingService

SAP Consumer

  • Consumer Proxy: CO_SRT_IPING_SERVICE_OUT

5.3.3.4      Microsoft Scenario Details

  • Details of specific scenario: Mutual X.509 Certificate Authentication; Sign Encrypt, Derived Keys, and Signature Confirmation features enabled; WS-Security 1.1.
  • Feature area: Security.WsSecurity.
  • Scenario: XD-SEES_Addressing10.
  • Source folder: C:\test\wcf\src\suite\XwsInterop\Security\WsSecurity.
  • Specific WS-Policy of interest: XD-SEES_Addressing10_IPingService_policy in http://NETServer/Security_WsSecurity_Service_Indigo/WsSecurity11.svc?wsdl=wsdl0.
  • Specific configuration binding: XD-SEES_Addressing10 in the C:\test\wcf\src\suite\XwsInterop\Security\WsSecurity\service\indigo\Web.Config file.

5.3.4      Using Authentication with Issued Token for Single Sign-On

The following scenarios allow you to enable Single Sign-On of the consumer at the provider. You integrate an external Security Token Service (STS) into your system landscape and use it as a token broker.

If the consumer system successfully authenticates at the STS, it gets a security token for authentication at the provider.

SAP supports the following SAML-based scenarios:

This scenario was not part of the interoperability tests.

5.3.4.1      AS ABAP Provides a Service

Some preliminary steps are necessary to enable the scenarios.

AS ABAP is the provider: Configuring SSO/STS Scenario SAML Holder-of-key in the Provider System AS ABAP

Combine the authentication methods with the transport security on message level using symmetric encryption.

Select the following options in SOA Management (transaction SOAMANAGER) on the Provider Security tab.

Figure 26 Provider security settings for SSO scenario 1

Figure 27 Provider security settings for SSO scenario 2

AS ABAP is the consumer: Configuring SSO/STS Scenario SAML Holder-of-key in the Consumer System AS ABAP

5.3.4.2      SAP Scenario Details

SAP Provider

  • Service Definition: IPingServiceContract

SAP Consumer

  • Consumer Proxy: CO_SRT_IPING_SERVICE_CONTR_OUT

SAP Provider

  • Service Definition: IPingServiceContract

SAP Consumer

  • Consumer Proxy: CO_SRT_IPING_SERVICE_CONTR_OUT

5.3.4.3      Microsoft Scenario Details

The WCF Ping/Echo sources and binaries include clients and services for these scenarios.  However the STS is available only over the Internet.  This STS was implemented using an older version of Microsoft’s Windows Identity Foundation (WIF) product, a WCF extension.  That product and later versions used in Microsoft’s Active Directory Federation Services v2 (ADFS v2) product as well as ADFS v2 itself support many configurations that are interoperable with NetWeaver Application Server.

  • Username over HTTPs, Asymmetric key SAML token over HTTPS
  • Details of specific scenario: Username over Transport from client to STS. STS issues asymmetric key SAML token. That token is carried over HTTPS from client to service (relying party)
  • Feature area: Security.SecureExchange
  • Scenario: OasisScenario9
  • Source directory: C:\test\wcf\src\suite\XwsInterop\Security\SecureExchange
  • Specific service WS-Policy of interest: CustomBinding_IPingServiceContract4_policy in http://NETServer/Security_SecureExchange_FederatedService_Indigo/Ping.svc?wsdl
  • Specific configuration binding: OasisScenario9Binding in the C:\test\wcf\src\suite\XwsInterop\Security\SecureExchange\FederatedService\Indigo\Web.config file.
  • Specific STS WS-Policy of interest: CustomBinding_IWSTrust13Sync_policy in http://131.107.153.205:8080/trust?wsdl=wsdl0
  • Additional details about this STS are not currently available.

Note   This scenario uses the STS endpoint at https://131.107.153.205:8443/trust/UserName. The non-default port 8443 is important because the STS implementation hosted at http://131.107.153.205/trust uses WS-Policy 1.5, which SAP does not support. To review the list of supported protocols for these interoperability scenarios, see the Supported Standards section in this document.

  • Mutual Certificate (WSS11), Asymmetric key SAML token for Certificate
  • Details of specific scenario: Certificate over Transport from client to STS. STS issues asymmetric key SAML token. That token carried using mutual certificate message protection from client to service (relying party).
  • SAML token used as an endorsing supporting token – authentication only. HTTPS (SSL within that protocol) provides protection between client and STS. Mutual certificates provide protection between client and service (relying party).
  • Feature area: Security.SecureExchange
  • Scenario: OasisScenario10_EncSig
  • Source folder: C:\test\wcf\src\suite\XwsInterop\Security\SecureExchange
  • Specific WS-Policy of interest: CustomBinding_IPingServiceContract16_policy at http://NETServer/Security_SecureExchange_FederatedService_Indigo/Ping.svc?wsdl
  • Specific configuration binding: OasisScenario10Binding_EncSig in the C:\test\wcf\src\suite\XwsInterop\Security\SecureExchange\FederatedService\Indigo\Web.config file.
  • Specific STS WS-Policy of interest: CustomBinding_IWSTrust13Sync1_policy at http://131.107.153.205:8080/trust?wsdl=wsdl0
  • Additional details about this STS are not currently available.

Note   This scenario uses the STS endpoint at http://131.107.153.205:8080/trust/X509. The non-default HTTP port 8080 is important because the STS implementation hosted at http://131.107.153.205/trust uses WS-Policy 1.5. To review the list of supported protocols for these interoperability scenarios, see the Supported Standards section of this document.

5.3.5      Further Combinations

You can combine all security scenarios with Message Transmission Optimization Mechanism (MTOM) and Web Services Reliable Messaging 1.1.

When you are using message signature and encryption, on the SAP side you can select Ext. Signature and Header Protection. This activates the function’s signature confirmation, signature encryption, and header encryption of the WS-Security 1.1 standard.

If a request contains the signature, the response confirms the contained signature. The signature and signature confirmation are encrypted. An SAP provider encrypts trace and session headers, not the protocol headers provided by for example WS-RM, WS-Addressing, etc. An SAP consumer encrypts headers, if the WSDL document requires it.

Figure 28 Additional external signature and header protection

5.3.5.1      SAP Scenario Details

SAP Provider

  • Custom headers are not supported on SAP provider side.

SAP Consumer

  • Consumer Proxy: CO_IPING_SERVICE_HEADER_ONLY_E

5.3.5.2      Microsoft Scenario Details

  • Details of specific scenario: Mutual X509 Certificate Authentication, Sign Encrypt, Derived Keys, Encrypted Header, Signature Confirmation.
  • Feature area: Security.WsSecurity.
  • Scenario: XD-SEES_HeaderOnly.
  • Source folder: C:\test\wcf\src\suite\XwsInterop\Security\WsSecurity.
  • Specific WS-Policy of interest: XD-SEES_IPingServiceHeaderOnlyEncryptAndSign_policy in http://NETServer/Security_WsSecurity_Service_Indigo/WsSecurity11HeaderOnly.svc?wsdl=wsdl0.
  • Specific configuration binding: XD-SEES_Addressing10 in the C:\test\wcf\src\suite\XwsInterop\Security\WsSecurity\service\indigo\Web.Config file.

5.4    Reliability

5.4.1      SAP Reliable Messaging

Information about how to implement reliable messaging based on the WS-RM specification in AS ABAP is provided in documentation on the SAP Help Portal: Programming with Sequences

SAP Provider

  • Service Definition: IPing

SAP Consumer

  • External Name: IPingOut

5.4.2      Microsoft Reliable Messaging Scenario

The preceding Business scenario uses the protocols found in this scenario.

  • Feature area: ReliableMessaging
  • Scenario: OneWay_SecureReliable_Anonymous_SOAP12_WSAddressing10_RM11
  • Source folder: C:\test\wcf\src\suite\XwsInterop\ReliableMessaging
  • Specific WS-Policy of interest: CustomBinding_IPing12_policy in http://NETServer/ReliableMessaging_Service_WSAddressing10_Indigo/OneWay.svc?wsdl
  • Specific configuration binding: SecureReliable_Anonymous_Soap12_WSAddressing10_RM11_Binding in the C:\test\wcf\src\suite\XwsInterop\ReliableMessaging\Service_WSAddressing10\Indigo\Web.config file.

5.4.3      SAP Reliable Request-Response Patterns

AS ABAP does not support reliable request-response patterns. SAP introduced idempotent service handling instead. Find more information about idempotent services in the Idempotent Service Handling at SAP section.

5.4.4      Microsoft Request-Response, Reliable Messaging Using SOAP 1.2 Scenario

This service is included as an example of a configuration to avoid. It is not interoperable with SAP clients. The SAP platform does not support a similar service.

Note   On the SAP NetWeaver platform, all one-way services use reliable messaging and all request-response services do not.

  • Feature area: ReliableMessaging
  • Scenario: RequestReply_Reliable_Anonymous_Soap12_WSAddressing10_RM11
  • Source folder: C:\test\wcf\src\suite\XwsInterop\ReliableMessaging
  • Specific WS-Policy of interest: CustomBinding_IEchoString8_policy in http://NETServer/ReliableMessaging_Service_WSAddressing10_Indigo/RequestReply.svc?wsdl.
  • Specific configuration binding: Reliable_Anonymous_Soap12_WSAddressing10_RM11_Binding in the C:\test\wcf\src\suite\XwsInterop\ReliableMessaging\Service_WSAddressing10\Indigo\Web.config file.

5.4.5      Idempotent Service Handling at SAP

AS ABAP does not support reliable request-response communication based on the WS-RM standard. SAP recommends using the idempotent service handling instead.

Figure 29 Potential error situations in synchronous communication

Synchronous communication does not guarantee message delivery. If a request or the response to the request is not delivered, the service consumer/client retries to send the request. That could lead to more than one service executions in the service provider system.

For many services however, it is crucial that the service is executed reliably once when requested. For example, if a new purchase order is to be created using a service invocation, it is neither acceptable to have no purchase order created nor to have two or more duplicates created.

To ensure reliable messaging for synchronous services, SAP provides a protocol on the application layer. All synchronous services that result in a database change have to be idempotent. That means a service call has the same effect irrespective of whether the provider receives the request message once or multiple times.

More information: Enterprise Services Index > Technical Concepts > Idempotent Service

5.4.5.1      SAP

To ensure that a service is idempotent, you have to do the following:

  • As a service consumer, use the MessageHeader element and its sub-element UUID in the services’ request messages.

The UUID values must be globally recognizable and satisfy the format that is specified, for example, in IETF RFC 4122. If you do not use the element when you call the services, the services do not behave in an idempotent manner.

If you use the special ABAP data type XSDUUID_RAW on provider the side, the parser checks for the pattern [0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F ]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12} and when matching removes the dashes and leaves only the characters.

If you do not use this data type, you have to handle the UUID on the application layer.

At the latest when calling the IDP helper APIs on the provider side, the internal UUID format (char32 like GUID, not case sensitive, without dashes) is required.

Note that the GUIDs used internally in ABAP systems do not satisfy the UUID format.

  • Before calling the idempotent services, use transaction WSIDPADMIN (Administration of Idempotent Service Layer) to configure the underlying framework, essentially the period for which the system keeps responses for already processed service calls.

Now, a consumer can safely re-send request messages.

  • Incorporate this retry decision in the consumer application's logic, using appropriate consumer application code, model, or, if the underlying framework already supports retry, by appropriate parameterization of the call to the framework when issuing the (first) service call.

There is a locking mechanism in place in case a message is resent during message processing. The developer on the application layer has then to decide how to handle and resolve this situation.

5.4.5.2      Microsoft

An application may use the System.Guid class to generate a UUID in the RFC 4122 format.  For example the messageHeader() method in default.aspx.cs of the Buyer project in the .NET Framework PO/Confirmation scenario implementation sets the MessageHeader element correctly though Idempotent Service Handling was not used in that scenario.  The UUID sub-element contains a value matching the format of an ABAP provider using the XSDUUID_RAW data type it expects.  If this value had instead been set as the ID sub-element was, it would match the format of an ABAP application using the internal UUID format it expects.

Figure 29 provides a generalization of this approach that may be useful in a .NET Framework service that implements Idempotent Service Handling.  If applied to the UUID element in a MessageHeader, the .NET Framework application would accept values in the format described above for the XSDUUID_RAW data type.  The guidValue field of the class also provides simple comparisons to lists of executing and past requests that the application should maintain.

Figure 30 UUID validation

5.5    Data Types

5.5.1      Base Data Type Testing

SAP note 944029 (login required) provides an overview of the elements of the XML schema and Web Services Description Language (WSDL) supported by ABAP proxy generation.

Find detailed information and recommendations about how to map XSD elements to ABAP data types in the ABAP workbench (transaction SE 80).

Select  (Tips&Tricks for Proxy Generation) > Mapping XSD to ABAP Data Types.

5.5.1.1      Requests and Responses that Contain XSD Float, Double, or Decimal Data Types

If for requests and responses the value for xsd:float (32-bit floating-point numbers), xsd:double (64-bit floating-point), xsd:decimal can be outside the ABAP range, set the ABAP technical type to STRING and implement the mapping to a suitable data type on the application layer.

5.5.1.2      Requests and Responses that Contain XSD Long, unsignedLong, and unsignedInt Datatypes

In AS ABAP during generation xsd_long (64-bit signed integers), xsd:unsignedLong (unsigned integer of 64 bits) and xsd:unsignedInt (unsigned integer of 32 bits) data types are mapped to INT4 for each default.

Alternatively, you can select the following:

  • Map xsd:long (64-bit signed integers) to DEC(19).
  • Map xsd:unsignedLong (unsigned integer of 64 bits) to DEC(20).
  • Map xsd:unsignedInt (unsigned integer of 32 bits) to DEC(10).

5.5.1.3      Base Datatype Testing Scenario SAP

SAP Provider

  • Service Definition: IBaseDataTypesDocLitB

SAP Consumer

  • Consumer Proxy: CO_SRT_IBDT_DOCLITB_OUT

5.5.1.4      Base DatatypeTesting using .NET Framework 4 XML Formatter and Document Literal Encoding Scenario

  • Feature area: SoapWsdl.BaseDataTypes.XmlFormatter.DocLitBare
  • Scenario: RetDouble and RetULong
  • Source folders: C:\test\wcf\src\suite\XwsInterop\Common\Indigo\SoapWsdl\BaseDataTypes provides test values for each data type and C:\test\wcf\src\suite\XwsInterop\SoapWsdl\BaseDataTypes\XmlFormatter implements the client and service with the client relying on values from Common folder.
  • Specific WSDL: http://NETServer/SoapWsdl_BaseDataTypes_XmlFormatter_Service_Indigo/BaseDataTypesDocLitB.svc?wsdl

Note   WS-Policy is not used with this scenario.

  • Specific configuration binding: Code-supplied configuration can be found in the C:\test\wcf\src\suite\XwsInterop\SoapWsdl\BaseDataTypes\XmlFormatter\service\Indigo\ BaseDataTypesServiceHostFactory.cs file.

5.5.2      Complex Data Type Testing

5.5.2.1      Requests and Responses that Contain Arrays Using xsi:nil

In AS ABAP, map arrays that may contain xsi:nil elements, for example empty rows, to xsdany and additionally implement on the application layer how this array must be read.

A standard procedure is in place, if fields have xsi:nil elements.

More information: Activating Extended XML Handling

Additionally, system documentation is available in AS ABAP that describes how you can use extended XML handling.

In AS ABAP, go to the ABAP workbench (transaction SE 80) and select  > ABAP Proxy Generation > Proxy Programming Model> Scroll down to Protocols and click the Protocols>IF_WSPROTOCOL_PAYLOAD link.

5.5.2.2      Complex Data Type Testing Scenario SAP

SAP Provider

  • Service Definition: IComplexDataTypesDocLitB

SAP Consumer

  • Consumer Proxy: CO_SRT_ICDT_DOCLITB_OUT

5.5.2.3      Complex Data Type Testing Scenario Microsoft

  • Feature area: SoapWsdl.ComplexDataTypes.XmlFormatter.DocLitBare
  • Scenario: RetArrayString2D
  • Source folders: The C:\test\wcf\src\suite\XwsInterop\Common\Indigo\SoapWsdl\ComplexDataTypes folder provides test values for each data type and the C:\test\wcf\src\suite\XwsInterop\SoapWsdl\ComplexDataTypes\XmlFormatter folder implements the client and service with the client relying on values from the Common folder.
  • Specific WSDL: http://NETServer/SoapWsdl_ComplexDataTypes_XmlFormatter_Service_Indigo/ComplexDataTypesDocLitB.svc?wsdl

Note   WS-Policy is not used with this scenario.

  • Specific configuration binding: Code-supplied configuration can be found in the C:\test\wcf\src\suite\XwsInterop\SoapWsdl\ComplexDataTypes\XmlFormatter\Service\Indigo\ComplexDataTypesServiceHost.cs file.

5.6    Message Transmission Optimization Mechanism (MTOM)

Using MTOM, you can separate binary data from a SOAP message and attach it as an XOP attachment. The attachment is connected to the message by a reference called XOPInclude.

Each binary data gets its own attachment. Using MTOM can result in better performance, because the message is smaller and parsing overhead is reduced.

5.6.1      SAP

All SAP providers support XOP optimization, there is no configuration necessary.

SAP consumers can choose to use XOP optimization when offered by the provider.

Figure 31 Consumer proxy configuration for optimized XML transfer

5.6.1.1      MTOM with WS-Security 1.0 (Mutual certificate authentication) Scenario

SAP Provider

  • Service Definition: IMtomTestLite

SAP Consumer

  • Consumer Proxy: CO_SRT_IMTOM_TEST_LITE_OUT

5.6.1.2      One-way reliable messaging using SOAP 1.2, composed with MTOM Scenario

SAP Provider

  • Service Definition: IMtomTestLite

SAP Consumer

  • Consumer Proxy: CO_SRT_IMTOM_TEST_LITE_OUT

5.6.2      Microsoft

The Business scenario detailed in this guide uses the protocols found in MTOM feature area.

Two scenarios are covered in this section to illustrate different approaches. The MTOM feature area is built using the configuration object model. The ReliableMessaging test is somewhat simpler because it uses a configuration file instead.

5.6.2.1      MTOM with WS-Security 1.0 (Mutual certificate authentication) Scenario

  • Feature area: MTOM
  • Scenario: Soap12Utf8WithSecurityEnabled
  • C:\test\wcf\src\suite\XwsInterop\MTOM
  • Specific WS-Policy of interest is CustomBinding_IMtomTestLite_policy in http://NETServer/MTOM_Service_Indigo/Soap12Utf8WithSecurity.svc?wsdl
  • Specific configuration binding: Code-supplied configuration can be found in the C:\test\wcf\src\suite\XwsInterop\MTOM\Service\Indigo\MtomServiceHost.cs file, specifically the MtomServiceHostSoap12Utf8WithSecurityEnabledFactory and MtomServiceHostSoap12Utf8WithSecurityEnabled classes.

5.6.2.2      One-way reliable messaging using SOAP 1.2, composed with MTOM Scenario

  • Feature area: ReliableMessaging
  • Scenario: OneWay_Reliable_Anonymous_SOAP12_WSAddressing10_RM11_ContractUsesByteArray
  • Source folder: C:\test\wcf\src\suite\XwsInterop\ReliableMessaging
  • Specific WS-Policy of interest: CustomBinding_IPingByteArray1_policy at http://NETServer/ReliableMessaging_Service_WSAddressing10_Indigo/OneWay.svc?wsdl
  • Specific configuration binding: Reliable_Anonymous_Soap12_WSAddressing10_RM11_ContractUsesByteArray_Binding in the C:\test\wcf\src\suite\XwsInterop\ReliableMessaging\Service_WSAddressing10\Indigo\Web.config file.

5.7    WS-Addressing

WS-Addressing defines a standard mechanism for identifying and exchanging Web services messages between multiple endpoints.

5.7.1      SAP

SAP providers do not define wsa:Action in the WSDL. However, you can configure a response action on the provider side.

In SOA Management (transaction SOAMANAGER), select a service with an endpoint and go to the Operation specific tab. There you can configure the action for the response message.

Figure 32 Consumer service configuration for setting wsa:Action

5.7.1.1      Request-response WS-Addressing with Anonymous ReplyTo, SOAP 1.2 Scenario

SAP Provider

  • Service Definition: Echo1

SAP Consumer

  • Consumer Proxy: CO_SRT_ECHO_OUT

5.7.1.2      One-way WS-Addressing with Anonymous ReplyTo, SOAP 1.2 Scenario

SAP Provider

  • Service Definition: Notify

SAP Consumer

  • Consumer Proxy: CO_SRT_NOTIFY_OUT

5.7.2      Microsoft

5.7.2.1      Request-response WS-Addressing with Anonymous ReplyTo, SOAP 1.2 Scenario

This example is interoperable between the .NET Framework 4 and SAP NetWeaver platforms.

  • Feature area: WSAddressing
  • Scenario: Test1231
  • Source folder: C:\test\wcf\src\suite\XwsInterop\WSAddressingCR
  • Specific WS-Policy of interest: CustomBinding_Echo1_policy at http://NETServer/WSAddressingCR_Service_WCF/WSAddressing10.svc?wsdl=wsdl1
  • Specific configuration binding: Code-supplied configuration can be found in the C:\test\wcf\src\suite\XwsInterop\WSAddressingCR\Service\WCF\WSAddressingCRServiceHostFactory.cs file.

5.7.2.2      One-way WS-Addressing with Anonymous ReplyTo, SOAP 1.2 Scenario

This service is included as an example of a configuration to avoid.  It is not interoperable with SAP clients.  The SAP platform does not support a similar service.

Note   On the SAP NetWeaver platform, all one-way services use reliable messaging and all request-response services do not.

  • Feature area: WSAddressing
  • Scenario: Test1200
  • Source folder: C:\test\wcf\src\suite\XwsInterop\WSAddressingCR
  • Specific WS-Policy of interest: CustomBinding_Notify1_policy in http://NETServer/WSAddressingCR_Service_WCF/WSAddressing10.svc?wsdl=wsdl1
  • Specific configuration binding: Code-supplied configuration can be found in the C:\test\wcf\src\suite\XwsInterop\WSAddressingCR\Service\WCF\WSAddressingCRServiceHostFactory.cs file.

5.8    WSDLs

5.8.1      Support for WSDL Styles: SAP

SAP supports WSDL styles document/literal, rpc/literal and document/literal wrapped. You can change the WSDL style by exchanging rpc with document or document_wrapped in the address of the service endpoint.

Figure 33 Generating different document styles in AS ABAP

You can also set the document style in SOA Management (transaction SOAMANAGER).

  1. Select a service definition and apply the selection.
  2. On the Overview tab page, select Show WSDL Options.
  3. Under WSDL Styles,you can select either Document or RPC.

It is the default that SAP generates WSDL document style document/literal and recommends using this style.

5.8.2      Support for WSDL Styles: Microsoft

.NET Framework 4 also supports document/literal, rpc/literal, and document/literal wrapped styles. Attributes applied to the service interface such as ServiceContractAttribute determine the message format. WSDL generated for the service matches the chosen format.

5.8.2.1      Runtime WSDL generation

.NET Framework 4 adds a new feature that avoids the problems of unreachable endpoint addresses in WCF-generated WSDLs.

The default has been to generate the WSDL for a service once, when the service is loaded. This generation uses the fully-qualified hostname – NETServer or NETServer.domain.example.com if the computer is part of a domain. In some cases, other computers may not know this name. Those computers might require the use of an IP address or a separate DNS name. This is a particular problem for Internet-facing services as changing names can cause confusion in many tools reading the WSDL.

.NET Framework 4 supports a service behavior that causes the runtime to generate a WSDL for each request, using the hostname in the request for all endpoint addresses. Therefore, if a client can reach a service to request its WSDL, the endpoints listed are also reachable.

To enable runtime WSDL generation

  1. Click Start, click All Programs, click Microsoft Visual Studio 2010, right-click Microsoft Visual Studio 2010, and then click Run as Administrator
  2. If a User Account Control dialog box appears, type in your administrator credentials if necessary, and then click Yes.
  3. Click File, click Open, and then click File.
  4. In the Open File dialog box, navigate toC:\Windows\Microsoft.NET\Framework\v4.0.30319\Config or C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config on a 64-bit version of Windows, select Machine.config, and then click Open.
  5. Search through the file to find the end tag of the <system.serviceModel> element.
  6. On the line before the end tag, add the following elements:

    <commonBehaviors>
      <serviceBehaviors>
        <useRequestHeadersForMetadataAddress/>
       </serviceBehaviors>
    </commonBehaviors>

  1. Click File, and then click Save Machine.config.
  2. Close Visual Studio.

5.8.3      Requests and Responses that Contain Application-Defined Headers

Application-defined “custom” headers are generally not part of the SAP programming model.

The provider system can only support unencrypted technical headers (that are part of the RM protocol) for the SOAP runtime. Only SAP headers (such as trace and session headers) are encrypted.

SAP Web service consumers can set custom headers in the header protocol. If custom headers are indicated in a provider WSDL, you can set and encrypt them if this is required.

5.8.3.1      Microsoft Scenario Details

SAP Web service clients can interoperate with the service in the following configuration.  However the SAP platform does not support a similar service.

  • Details of specific scenario: Mutual X509 Certificate Authentication, Sign Encrypt, Encrypted Header.
  • Feature area: Security.WsSecurity.
  • Scenario: XD_NoDerivedkeys_HeaderOnly-NoSignatureConfirmation.
  • Source folder: C:\test\wcf\src\suite\XwsInterop\Security\WsSecurity.
  • Specific WS-Policy of interest: XD_NoDerivedKeys-NoSignatureConfirmation_IPingServiceHeaderOnlyEncryptAndSign_policy in http://NETServer/Security_WsSecurity_Service_Indigo/WsSecurity11.svc?wsdl=wsdl0.
  • Specific configuration binding: XD_NoDerivedKeys-NoSignatureConfirmation in the C:\test\wcf\src\suite\XwsInterop\Security\WsSecurity\service\indigo\Web.Config file.

5.8.3.2      SAP Scenario Details

SAP Consumer

  • Consumer Proxy: CO_SRT_IPING_SERVICE_OUT

5.8.4      Request with Empty Body Element

5.8.4.1       SAP Scenario Details

SAP NetWeaver does not support empty SOAP bodies in request and response messages. SAP’s programming model does not support empty bodies, neither on the consumer, nor on the provider. In the ES Repository, it is not possible to model services without a message type for the request message. The SAP runtimes require this request message type (non-empty) in the message body.

Adjust the WSDL so that it does not contain an empty body.

5.8.4.2      Microsoft Scenario Details

This service is included as an example of a configuration to avoid. It is not interoperable with SAP clients due to the empty Body element. The SAP platform does not support a similar service.

  • Details of specific scenario: WS-Addressing Dispatch test (not part of W3C WS-Addressing WG suite), SOAP 1.2
  • Feature area: WSAddressing
  • Scenario: Test1299
  • Source folder: C:\test\wcf\src\suite\XwsInterop\WSAddressingCR
  • Specific WS-Policy of interest: CustomBinding_Dispatch_policy at http://NETServer/WSAddressingCR_Service_WCF/WSAddressing10.svc?wsdl=wsdl1
  • Specific configuration binding: Code-supplied configuration can be found in the C:\test\wcf\src\suite\XwsInterop\WSAddressingCR\Service\WCF\WSAddressingCRServiceHostFactory.cs file.
  • Specific contract of interest: http://NETServer/WSAddressingCR_Service_WCF/WSAddressing10.svc?wsdl=wsdl3
  • Contract code location: C:\test\wcf\src\suite\XwsInterop\WSAddressingCR\Service\WCF\DispatchContract.cs.

Note   This file includes multiple pairs of operations that are distinguished only by their WS-Addressing Action values; one pair of operations has empty Body elements.