Modifying Outbound Requests

Enrich your outbound Integration API requests by modifying request headers and payloads.

Systems sometimes require specific header properties or parameters in incoming requests. If you send outbound requests using the Integration API, you might need to modify the requests, depending on the needs of the target system. To enrich an outbound request, register a new decorator using one of these methods:
  • Modify the current decorator list. All clients share the new decorator.

  • Define a custom list and assign it to a custom OutboundServiceFacade object. This method allows clients to have unique configurations.

The following examples describe how to modify an existing decorator list or define a new list, depending on your needs.

Modifying an Existing Decorator List

You can modify an existing decorator list via bean wiring. Use the following code as an example.
<beans ...>

	<bean id="myCustomDecorator" class="com.company.MyOutboundRequestDecorator" />

	<bean id="outboundRequestDecoratorList" parent="outboundRequestDecoratorList" class="org.springframework.beans.factory.config.ListFactoryBean">
		<property name="sourceList">
			<list merge="true">
				<ref bean="myCustomDecorator" />
			</list>
		</property>
	</bean>

</beans>

Defining a Custom List

Custom lists allow clients to have unique configurations without affecting other clients. To define a decorator for use by specified clients, define a new OutboundRequestFacade using the following code as an example.
<beans ...>

	<bean id="myCustomDecorator" class="com.company.MyOutboundRequestDecorator" />

	<bean id="myOutboundServiceFacade" parent="outboundServiceFacade">
		<property name="outboundRequestDecorators">
			<bean  parent="outboundRequestDecoratorList" class="org.springframework.beans.factory.config.ListFactoryBean">
				<property name="sourceList">
					<list merge="true">
						<ref bean="myCustomDecorator" />
					</list>
				</property>
			</bean>
		</property>
	</bean>

	<bean id="myService" class="com.company.service.MyServiceImpl">
		<property name="outboundServiceFacade" ref="myOutboundServiceFacade" /> <!-- here we make sure we use OUR outboundServiceFacade -->
	</bean>

</beans>

SAP Passport ID

When requests are sent out of SAP Commerce, they are decorated with an SAP Passport ID. The header is added to the outbound request with the name SAP-PASSPORT. The value contains a Hex-encoded string of the <DSRPassport>.

You can configure the creation of the Passport with the following properties.
Key Default Value
integrationservices.sap.passport.systemid SAP Commerce
integrationservices.sap.passport.service 39
integrationservices.sap.passport.user This value defaults to the current user's UID. You can overwrite this value, but if you override the value in the Administration Console (HAC), the new value is not guaranteed to match an existing user ID.