Testing the Deployed Media Object Published Business Service

This section provides a brief overview of how you can test the Select, Insert, and Delete Media Object operations of a Media Object published business service.

Select

To test the Select operation, you should test retrieving a single media object and also test retrieving multiple media objects. If you want to retrieve a single record at a time, you must provide the sequence number of the media object through the value object. If you do not provide the sequence number, then the Select operation may retrieve multiple media objects. You can select the media objects based on the Media Object type. In this case, you will retrieve all of the media objects of that Media Object type for that key (such as address book number in the case of RI_AddressBookMediaObjectManager BSSV). If you do not provide the sequence number and Media Object type, then the select operation will retrieve all of the media objects for that key.

The following sample code is an XML snippet for selecting multiple media objects based on the Media Object type FILE. This will return all media objects for address book number 1001 with a Media Object type of FILE.

<mediaObject>
            <mnAddressNumber>1001</mnAddressNumber>
            <moItems>
               <szMoType>FILE</szMoType>
            </moItems>
 </mediaObject>

The following sample code is an XML snippet for selecting a single attachment based on the sequence number. This will return a media object with a sequence number of 1 for address book number 1001.

<mediaObject>
            <mnAddressNumber>1001</mnAddressNumber>
            <moItems>
               <moSeqNo>1</moSeqNo>
            </moItems>
 </mediaObject>

The following sample code is an XML snippet for selecting all the attachments. This will return all media objects, including media objects of type FILE, URL and TEXT, for address book number 1001.

<mediaObject>
            <mnAddressNumber>1001</mnAddressNumber>
            <moItems>
            </moItems>
 </mediaObject>

In addition, there is an option to list only the media object details such as sequence number, media object name, media object type and so forth, without the attachments. In this case, you would set the downloadMediaObject member variable to false in the internal Media Object value object. The preceding sample XML inputs for a Select operation are valid for listing media objects.

Insert

To test the Insert operation of any media object, you have to test inserting the different Media Object types supported, which are FILE, TEXT and URL.

If you are inserting a FILE attachment, provide the following information:

  • Media Object type (<szMoType>) as FILE.

  • Attachment data (<szData>).

  • Media Object Item Name (<szItemName>). Enter the file name of the media object in this field.

If you are inserting the TEXT attachment, provide the following information:

  • Media Object type (<szMoType>) as TEXT

  • Attachment data (<szData>).

    Media Object Item Name is not required for TEXT media objects.

If you are inserting a URL attachment, provide the following information:

Media Object type (<szMoType>) as URL.

Media Object Item Name (<szItemName>). Enter the URL to be stored in this field.

The following sample code is an XML snippet for inserting three media objects: a FILE attachment, a URL attachment, and a TEXT attachment:

<mediaObject>
            <moItems>
               <szData>cid:README.pdf</szData>
               <szItemName>README.pdf</szItemName>
               <szMoType>FILE</szMoType>
            </moItems>
       <moItems>
               <szData>cid:text.txt</szData>
               <szMoType>TEXT</szMoType>
            </moItems>
            <moItems>
               <szItemName>www.oracle.com</szItemName>
               <szMoType>URL</szMoType>
            </moItems>
</mediaObject>

Delete

To test the Delete operation, test deleting a single media object and also test deleting multiple media objects in a single web service call. If you want to delete only a single media object at a time, provide the sequence number of the media object through the value object. If you do not provide the sequence number, then the Delete operation may delete multiple media objects based on the query criteria.

You can delete media objects based on the Media Object type. When based on the Media Object type, all media objects of that particular Media Object type for that key (such as address book number in the case of RI_AddressBookMediaObjectManager BSSV) will be deleted. If you do not provide both the Media Object sequence number and Media Object type, then the Delete operation will delete all the media objects for that key.

The following sample code is an XML snippet for deleting multiple media objects based on the Media Object type FILE. This will delete all FILE type media objects for address book number 1001.

<mediaObject>
            <mnAddressNumber>1001</mnAddressNumber>
            <moItems>
               <szMoType>FILE</szMoType>
            </moItems>
 </mediaObject>

The following sample code is an XML snippet for deleting a single attachment based on the sequence number. This will delete the media object with a sequence number of 1 for address book number 1001.

<mediaObject>
            <mnAddressNumber>1001</mnAddressNumber>
            <moItems>
               <moSeqNo>1</moSeqNo>
            </moItems>
 </mediaObject>

The following sample code is an XML snippet for deleting all attachments. This will delete all media objects, including media objects of type FILE, URL and TEXT, for address book number 1001.

<mediaObject>
            <mnAddressNumber>1001</mnAddressNumber>
            <moItems>
            </moItems>
 </mediaObject>

Before you test a JAX-WS-based Media Object published business service, you follow the same preliminary steps that you would perform to test any published business service, which include:

  • Creating a deployment profile for a Media Object published business service.

  • Deploying the Media Object published business service project to the integrated WebLogic Server.

See Testing the Deployed Published Business Service in this guide for details.

After you successfully deploy the Media Object published business service to the integrated WebLogic Server, test it. You can use the following URL to access the WebLogic Server Administration Console:

http://<JDEV_MACHINE_HOST>:<JDEV_INTEGRATED_WLS_SERVER_PORT>/console/login/Loginform.jsp

To test the JAX-WS-based Media Object published business service on the integrated WebLogic Server:

  1. Access and log in to the integrated WebLogic Server Administration Console.

  2. In the "Applications and Modules Deployed for this Server" area, expand the appropriate published business service.

  3. Expand the Web Services name and click your web service; an example web service name is RI_AddressBookMediaObjectManagerService.

    The "Settings for web service name" page is displayed in the Administration Console.

  4. Select the Testing tab to access the Deployment Tests page.

  5. In the Deployments Tests area, expand the name and click on the ?WSDL in the Test Point column.

    WSDL is displayed on the new tab. Record or note the WSDL URL.

  6. For testing business services, open a web service testing tool such as SOAPUI and select File, New SOAPUI Project.

  7. Enter the WSDL URL, which you recorded in step 5, enter the Project name, and then click OK.

  8. The SoapUI project appears in the left pane. Expand your Soap Operation and double-click Request1.

    Depending on the operation that you want to invoke, modify your request document and test your business service.

    Example: The following example shows the input xml and configuration steps for invoking the addAddressBookMO operation of the RI_AddressBookMediaObjectManager web service, which will insert two FILE media objects and one TEXT media object.

    <orac:addAddressBookMO>
            <businessUnit>1</businessUnit>
            <entityName>Media Object Test</entityName>
            <entityTypeCode>C</entityTypeCode>
            <mediaObject>
                <moItems>
                   <szData>cid:README.pdf</szData>
                   <szItemName>README.pdf</szItemName>
                   <szMoType>FILE</szMoType>
                </moItems>
        <moItems>
                   <szData>cid:text.txt</szData>
                   <szMoType>TEXT</szMoType>
                </moItems>
                <moItems>
                   <szData>cid:Green.gif</szData>
                   <szItemName>Green.gif</szItemName>
                   <szMoType>FILE</szMoType>
                </moItems>
            </mediaObject>
    </orac:addAddressBookMO>
    
    1. Click the Add an Attachment button and browse and select for your attachment. You may need to repeat this step to add multiple attachments.

    2. Change the request parameters to Enable MTOM = true and Disable Multiparts = False.

      These properties are displayed in the lower left side of the SOAPUI pane.

    3. Submit the request.

    4. Check the Service Response to verify the invocation was successful.

    Example: The following example shows the input xml and configuration steps for invoking the getAddressBookMO operation of the RI_AddressBookMediaObjectManager web service, which will select all media objects of type FILE for address book number 605864.

          <orac:getAddressBookMO>
            <entity>
                <entityId>605864</entityId>
             </entity>	
             <mediaObject>
                <mnAddressNumber>605864</mnAddressNumber>
                <moItems>
                   <szMoType>FILE</szMoType>
                </moItems>
     </mediaObject>
           </orac:getAddressBookMO>
    1. Change the request parameters to "Enable MTOM = true" and "Disable Multiparts = False"

      These properties are displayed in the lower left side of the SOAPUI pane.

    2. Submit the request.

    3. Check the Service Response to verify the invocation was successful.

    4. If you choose to do so, you can save the Attachments by clicking the Export Icon in the Attachment Pane of the response.

    5. On the Service Response, verify the test was successful.

    Example: The following example shows the input xml and configuration steps for invoking the deleteAddressBookMO operation of the RI_AddressBookMediaObjectManager web service, which will delete all media objects of type FILE for address book number 605864.

    <orac:deleteAddressBookMO>
            <entity>
                <entityId>605864</entityId>
             </entity>   
             <mediaObject>
                <mnAddressNumber>605864</mnAddressNumber>
                <moItems>
                   <szMoType>FILE</szMoType>
                </moItems>
     </mediaObject>
           </orac:deleteAddressBookMO>
    
    1. Submit the request.

    2. Check the Service Response to verify the invocation was successful.

When testing the business service, you can configure the following logs to collect information for troubleshooting issues that might occur:

  • Business services logs

    In the jdelog.properties file, located in the <E1_Install_Path>\ini\sbfFolder, turn on the business service log with Level=Debug and Component=ALL. If you change the jdelog.properties file, you must redeploy the published business service project to the integrated WebLogic server.

  • IntegratedWeblogicServer log

    For JDeveloper 12c, this log is located at:

    C:\Documents and Settings\USER_PROFILE\Application Data
    \JDeveloper\system12.1.2.*\DefaultDomain\servers\DefaultServer\logs

    For JDeveloper 11g, this log is located at:

    C:\Documents and Settings\USER_PROFILE\Application Data \JDeveloper\system11.1.1.*\DefaultDomain\servers\DefaultServer\logs