- Running the Mediator API Sample Projects This page last changed on Jun 23, 2008. .stickable, h1, h2, h3, h4, h5 false true Show Sticky notes Hide Sticky notes sticky_configuringtheldapserverinformation sticky_associatingcustomconditionallogicwithfunctions sticky_aldspapplicationdevelopmentbestpractices sticky_configuringthesampleapplicationtousetheembeddedldapserver sticky_acloserlook Save Cancel edocs Home > BEA AquaLogic Data Services Platform 3.0/3.2 Documentation > ALDSP 3.2 New Features Documentation ## How To Run the Mediator API Sample Projects This topic describes how to run the Mediator API sample projects. ##### Topic Map How To Run the Mediator API Sample Projects Running the Standalone Samples Using the Custom Run Configuration Running the Sample Controls Using "Run on Server" Using the Advanced APISample Projects with ALDSP 3.0 Related Topics Advanced API Samples - Mediator, Web Services, and DSP Controls ### Running the Standalone Samples Using the Custom Run Configuration You can run the following standalone Mediator API sample projects using a custom configuration: `DSPClientSamplesStatic1` `DSPClientSamplesDynamic1`
  | How to Set Up the Sample Applications
2. Here are the instructions for running the static ALDSP client API sample: Launch Workspace Studio. Verify that the server is started and the RetailDataspace sample project is deployed.
   | If an unexpected problem is flagged in the Project Explorer, try the Clean project option
       Project > Clean
3. Make sure the Console window is open:
       Window > Show View > Other > Console
Right-click on DSPClientSamplesStatic1 and choose Run As > Run. Expand Java Application and select the Static run configuration. Click Run. You can run the DSPClientSamplesDynamic1 sample using the steps shown above. ##### Selecting the Run Configuration The sample project includes an optional parameter enabling you to choose the following client types: Use `java` or do not set the parameter to have the sample project use the Mediator API. Use `webservice` to have the sample project use the Web Service Mediator API. The parameter can be specified in the Arguments tab as a program argument such as:
    webservice
##### Specifying an Argument The results appear in the Console Window. ##### Console After Running Static Mediator Sample with webservice Parameter #### Running the Sample Controls Using "Run on Server" You can run the Mediator API sample controls using the "Run on Server" option.
| If you see "Missing Struts Module Configuration" when trying to run the Mediator API sample controls, it is likely because you need to install WebLogic Workshop 10.2 (in addition to what comes with the ALDSP installer). You can download WebLogic Workshop 10.2 at http://commerce.bea.com/showproduct.jsp?family=WLW&major=10.2&minor=0
To run the sample projects: Launch Workspace Studio. Verify that the server is started and the RetailDataspace sample project is deployed. Right-click the dataspace project and choose Run As > Run on Server. ##### Selecting the Server Select the server and click Next. ##### Adding the Project Add the required project, and click Finish. You can specify an optional parameter to use the Mediator API or Web Services Mediator API. #### Using the Advanced APISample Projects with ALDSP 3.0 The samples are tested with ALDSP 3.2 and 3.01. If you are using ALDSP 3.0, you need to call the `getContextClassLoader()` method before accessing the DataAccessService. Specifically, when using the Java or DSP Control Mediator API, call the following method before accessing the DataAccessService:
    com.bea.dsp.das.HelperContextCache.setClassLoader("RetailDataspace", Thread.currentThread.getContextClassLoader();
Similarly, when using the Web Services Mediator API, call the following method before accessing the DataAccessService:
    com.bea.dsp.das.HelperContextCache.setClassLoader(
       "http://localhost:7001/RetailDataspace/RetailApplication/CustomerManagement/ProfileService.ws?WSDL",
       Thread.currentThread.getContextClassLoader());
## Related Topics ##### How Tos Advanced API Samples - Mediator, Web Services, and DSP Controls Setting Up the Advanced API Sample Projects ##### Reference Understanding the Advanced Static Mediator API Sample Static Mediator API Code Reference Dynamic Mediator API Code Reference ALDSP Control Static Mediator API Code Reference ALDSP Control Dynamic Mediator API Code Reference

Document generated by Confluence on Nov 26, 2008 13:06