Invoke Order Web Services on behalf of another user

Technote (FAQ)


Question

How can one invoke the Order Web Service on behalf of another user?

Answer

If you would like to invoke the Order service with a user on behalf of another user (a CSR for example), try using the following steps:

1. Create a new folder named 'com.ibm.commerce.order-ext' under WC/xml/config

2. Create a new configuration file named 'wc-component.xml' under the new folder. You can use the original file in WC/xml/config/com.ibm.commerce.order as a template.

3. Add the following snippet in to the new file.

<_config:authorization-configuration>
<_config:protectable-proxy protectable="com.ibm.commerce.foundation.server.authorization.policymanager.ForUserProtectableProxy"
interfacename="com.ibm.commerce.Order.facade.datatypes.OrderType" />
</_config:authorization-configuration>


A sample modified wc-component.xml looks like:

<_config:DevelopmentComponentConfiguration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ibm.com/xmlns/prod/commerce/foundation/config ../xsd/wc-component.xsd "
xmlns:_config="http://www.ibm.com/xmlns/prod/commerce/foundation/config">

<_config:authorization-configuration>
<_config:protectable-proxy
protectable="com.ibm.commerce.foundation.server.authorization.policymanager.ForUserProtectableProxy" interfacename="com.ibm.commerce.Order.facade.datatypes.OrderType" />
</_config:authorization-configuration>
</_config:DevelopmentComponentConfiguration>


4. Add the forUserId data in the business context section of the SOAP request

<oa:ApplicationArea xsi:type="_wcf:ApplicationAreaType">
<oa:CreationDateTime>2008-06-26T22:10:50.218Z</oa:CreationDateTime>
<oa:BODID>ae07cbf0-4389-11dd-a38a-82f1486392d7</oa:BODID>
<_wcf:BusinessContext>
<_wcf:ContextData name="storeId">11153</_wcf:ContextData>
<_wcf:ContextData name="forUserId">add forUserId here</_wcf:ContextData>
</_wcf:BusinessContext>
</oa:ApplicationArea>


For example, when utilizing the OrderFacadeClient API, you may use code similar to the following to add the context:

CallbackHandler callbackHandler = null;
BusinessContextType iBusinessContext = CommerceFoundationFactory.eINSTANCE.createBusinessContextType();
ContextDataType cForUserId = CommerceFoundationFactory.eINSTANCE.createContextDataType();
cForUserId.setName("forUserId");
cForUserId.setValue(userId);

iBusinessContext.getContextData().add(cForUserId);

OrderFacadeClient orderFacadeClient = new OrderFacadeClient(iBusinessContext, callbackHandler);
...
...


Related information

Order Noun (Web Service)
Class CommonOrderFacadeClient

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

WebSphere Commerce Enterprise
Orders

Software version:

6.0, 7.0

Operating system(s):

AIX, IBM i, Linux, Solaris, Windows, i5/OS

Reference #:

1620593

Modified date:

2013-10-16

Translate my page

Machine Translation

Content navigation