6 Working with JD Edwards EnterpriseOne as a Web Service Provider

This chapter contains the following topics:

Note:

Oracle reserves the right to reorganize the business services foundation packages (jar files) for tools release upgrades. If you are planning to upgrade your system, test your custom objects and modify them as appropriate to ensure your code will continue to work as intended. You cannot upgrade custom business service objects after you install a tools release upgrade.

6.1 Understanding JD Edwards EnterpriseOne as a Web Service Provider

Note:

If you are using JD Edwards EnterpriseOne Tools Release 9.2 with JD Edwards EnterpriseOne Applications Release 9.2, JDeveloper 12c is installed on your system. With JDeveloper 12c, you can create JAX-WS business services only.

If you are using JD Edwards EnterpriseOne Tools Release 9.2 with JD Edwards EnterpriseOne Applications Release 9.0 or 9.1, JDeveloper 11g is installed on your system. With JDeveloper 11g, you can create JAX-WS and JAX-RPC business services.

You use JDeveloper and the Business Services Framework to create published business services and business services. If you are using JDeveloper 12c, do not use APIs that are specific to JDK1.7.

If are using JDeveloper 11g, you can create web services from the published business service using JAX-RPC or JAX-WS web services standards.

6.1.1 Published Business Services

A published business service is an Object Management Workbench (OMW) object consisting of one or more classes. One of the classes is the published business service class, which is the class that publishes methods that are exposed to the public. This public method wraps an internal business service method, where the actual business logic is performed. The published business service contains the value object classes that are received and returned by the published methods. A web service is generated from the published business service class, and the public methods of this class are operations within that web service.

After a business service is published, you cannot change the name and signature of the business service without affecting the consumers of that service. If you change an underlying business service that the published method exposes, then you change the signature and contract of the published business service.

6.1.2 Business Services

A business service is an OMW object consisting of one or more classes. One of the classes is a business service class, which is a Java class that has public methods that are used by other business services and published business services. The methods access logic in JD Edwards EnterpriseOne and support a specific step in a business process. When you create the business service class, you should consider including methods that have similar functionality and manageability in the same business service class. If multiple processes are similar and can reuse code, then these methods should exist in the same business service.

You can modify a business service providing that the change does not alter the signature or behavior of the published business service. You can change a business service in many ways, and how you change the business service depends on the business service design and the type of change that is required. Any change to a business service should be determined as part of the design process. Business service methods can call business functions, database operations, or another business service.

6.1.2.1 Calling a Business Function

You can create business service methods that call business functions. A business function is an encapsulated set of business rules and logic that can be reused by multiple applications. Business functions provide a common way to access the JD Edwards EnterpriseOne database. A business function performs a specific task. You use the business service foundation Business Function Call Wizard to create a business function call.

6.1.2.2 Calling a Database Operation

You can create business service methods that call database operations. Database operations include query, insert, update, and delete. You use the business service foundation Database Call Wizard to create these business services.

6.1.2.3 Transaction Processing

Transaction processing is a way to update the JD Edwards EnterpriseOne database. A transaction is a logical unit of work performed on the database to complete a common task and maintain data consistency. The database is updated when a transaction is either automatically or manually committed. The business service framework provides two types of default transactions: manual commit connection and auto commit connection.

For a single manual commit transaction, the default behavior is to scope all processing within the published business service method. If any operation within this scope fails, all operations are rolled back, and the published business service method throws an exception. This behavior is recommended when you commit multiple records to multiple tables.

For a single auto commit transaction, the default behavior is for each operation to commit or roll back immediately, which means that each table update within each business function call is either committed or rolled back immediately. This behavior is recommended for queries for which no transaction is needed or when you commit a single record to a single table.

When you are deciding which type of connection to use, you should always consider the business function behavior.

Default transaction behavior should cover most scenarios, but you can define a business service method that explicitly manages transactions. When determining whether a business service requires explicit transaction processing, you should review current JD Edwards EnterpriseOne functionality in the application. If the application uses explicit transaction processing, you should carefully review whether the business service should handle transaction processing the same way.

The JD Edwards EnterpriseOne Tools Business Services Development Methodology Guide provides a detailed discussion about transaction processing. In addition, the chapters pertaining to creating a published business service and creating a business service provide an overview of creating a transaction.

See also:

"Auto Commit" in the JD Edwards EnterpriseOne Tools Business Services Development Methodology Guide.

6.1.3 Business Service Properties

Business service properties provide a way for you to change a value in a business service method without changing the method code. A business service property consists of a key and a value. The key is the name of the business service property and cannot be changed. Business service properties are OMW objects. You can use OMW or the Business Service Property Admin program (P951000) to create and maintain them.

6.2 Creating a Custom Published Business Service

JD Edwards EnterpriseOne provides reference implementations that you can use as a model for creating a published business service. The reference implementations are for reference only and are not intended to be used in a production environment. The following steps provide how-to information for creating a custom published business service that can be exposed as a web service:

  1. Determine whether to create a new published business service or extend an existing published business service.

  2. Create a new OMW object for the published business service.

  3. Add classes to the published business service object.

    • Create published business service class.

      – Name the published business service class.

      – Create a transaction.

      – Name the published business service methods.

    • Create value object classes.

      – Create business function value object classes.

      – Name the input value object classes.

      – Name the response value object classes.

      – Use valid data types.

    • Create database operation value object classes.

      – Name the input value object classes.

      – Name the response value object classes.

      – Use valid data types.

  4. Add business logic.

    • Call business services.

    • Handle errors.

    • Format data.

  5. Test the published business service.

6.3 Testing a Published Business Service

You use tooling provided by JDeveloper to test and debug published business service methods. The published business service class is generated to a web service described in Web Services Description Language (WSDL) format and runs on JDeveloper.

After the published business service is tested as a web service, you verify that the WSDL is compliant. You use JDeveloper for this task.

For more information about Oracle JDeveloper, see the Oracle Fusion Middleware User's Guide for Oracle JDeveloper. This document is located under the Fusion Middleware section on the documentation page of the Oracle Technology Network website.

6.4 Creating a Custom Business Service

JD Edwards EnterpriseOne provides reference implementations that you can use as a model for creating business services that are specific to your interoperability requirements. The following steps provide how-to information for creating a custom business service:

  1. Determine whether to create a new business service or modify an existing business service.

  2. Create a new OMW object for the business service.

  3. Add classes to the business service object.

    • Create a business service class.

      – Name the business service class.

      – Create a transaction, if necessary (IConnection objects).

      – Declare the business service public methods.

    • Create the internal value object class.

      – Name the internal value object class.

      – Transform data types.

  4. Add business service logic.

    • Create a business function call.

    • Create a database call.

    • Call existing business service methods.

    • Use business service properties.

    • Handle errors.

    • Format data.

6.5 Creating Java Standards-Based Web Services in JDeveloper

JDeveloper provides wizards that enable you to create web services from a published business service. The JDeveloper tool includes the integrated WebLogic server that enables you to test your web service. After you create a web service, you deploy it to the integrated WebLogic server so that you can test the web service.

Note:

If you are using JD Edwards EnterpriseOne Tools Release 9.2 with JD Edwards EnterpriseOne Applications Release 9.2, JDeveloper 12c is installed on your system. With JDeveloper 12c, you can create only JAX-WS business services.

If you are using JD Edwards EnterpriseOne Tools Release 9.2 with JD Edwards EnterpriseOne Applications Release 9.0 or 9.1, JDeveloper 11g is installed on your system. With JDeveloper 11g, you can create JAX-WS and JAX-RPC business services.

6.5.1 Creating a JAX-WS Web Service in JDeveloper

Note:

This section is applicable for JDeveloper 12c and JDeveloper 11g.

After you create and successfully compile a published business service, you can use JDeveloper to create a JAX-WS web service. You create the published business service manager and value object Java files using existing business service development methodology.

Before you run the JDeveloper JAX-WS Web Service wizard to create a web service from a published business service, you move the JAX-WS Web Services library to the top of the Libraries and Classpath properties page so that JDeveloper builds the published business service using the desired web-service standard.

Note:

The steps to create a JAX-WS web service also apply to creating a Media Object web service, except that you need to select the Enable MTOM check box in the Message Format page. See the steps in ”To create a JAX-WS-based web service from a published business service” for details.

To select JAX-WS as the standard for a published business service:

  1. In JDeveloper, right-click the appropriate published business service project and select Project Properties.

    The Project Properties window for the selected published business service appears.

  2. In the left-hand side tree structure, select Libraries and Classpath.

    The Libraries and Classpath page appears on the right-hand side of the window.

  3. In the Classpath Entries area, select JAX-WS Web Services.

  4. Move the JAX-WS Web Services entry to the top of the page by clicking the Move Up button.

    Clicking the Move Up button moves the entry one level at a time; you may need to click the Move Up button multiple times to move the JAX-WS Web Services entry to the top of the page.

  5. Click OK.

  6. On JDeveloper, save the changes that you made to the Libraries and Classpath property of the selected published business service.

To create a JAX-WS-based web service from a published business service:

  1. In JDeveloper, expand the appropriate published business service project folder.

  2. Right-click on the published business service Manager Java file and select Create Web Service.

    The Create Java Web Service window appears with the Generation Options page available.

  3. On Generation Options, verify the system entered values for the Web Service Name and the Port Name fields.

  4. Click Next to open the Message Format page.

  5. On Message format, do the following:

    • Select SOAP 1.1 Binding option.

    • Select Document/.Literal from the SOAP Message Format drop-down list.

    • Note:

      If you are creating a Media Object published business service, select the Enable MTOM check box. For more information about Media Object published business services, see Understanding MTOM-Based Media Object Web Services in this guide.
    • Click Next to open the Methods page.

  6. On Methods, verify that all of the public methods that are defined for the published business service Manager Java file are listed and selected.

  7. Click Next to open the Additional Classes page.

  8. On Additional Classes, click Next to open the Configure Policies page.

  9. On Configure Policies, select the No Policies option.

  10. Click Next to open the Provide Handler Details page

  11. On Provide Handler Details, verify the system entered Port and click Next to open the Finish page.

  12. On Finish, click the Finish button to create the web service.

When JDeveloper successfully generates the JAX-WS web service, it also creates a web.xml file in the public_html/web-inf folder of the published business service project. JDeveloper also adds the following annotations to the beginning of the Java class in the PBSSV_Manager.java file.

  • @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)

  • @WebService

If you plan to create a JAX-WS based client for this JAX-WS web service and you want the same client to work with both the EnterpriseOne JAX-WS web service running locally on the JDeveloper Integrated WebLogic server and on a standalone WebLogic Server or WebSphere Application Server or both, replace the above annotations that JDeveloper inserted at the beginning of the PBSSV_Manager Java Class with the following annotations:

  • @SOAPBinding(style=SOAPBinding.Style.DOCUMENT, use=SOAPBinding.Use.LITERAL, parameterStyle=SOAPBinding.ParameterStyle.BARE)

  • @WebService(serviceName="RI_AddressBookManagerService", portName="RI_AddressBookManagerPort", targetNamespace="http://oracle.e1.bssv.JPR01000/")

Note:

The attributes in the @WebService annotation are specific for the RI_AddressBookManager published business service in the JPR01000 business service project. Change the attributes to reference the published business service that you specified for creating the JAX-WS web service.

Manual replacement of the annotations is required to set the targetNamespace attribute in the @WebService annotation with the proper package structure for the published business service project. If the replacement annotations are not specified, JDeveloper uses the reverse package structure; for example, JPR01000.bssv.e1.oracle, and in this scenario the client created for the local web service will not work with the server web service. If the above replacement annotations are made in the PBSSV_Manager Java Class, then they will be similar to the annotations added to the PBSSV_Manager Java Class during the business service package build process. A business service client created for a published business service running locally on either the JDeveloper 11g or JDeveloper 12c integrated WebLogic server also works with a published business service running on a standalone WebLogic server.

6.5.2 Creating a JAX-RPC Web Service in JDeveloper

Note:

This section is applicable for JDeveloper 11g only. With JDeveloper 12c, development of JAX-RPC web services is not supported.

After you create and successfully compile a published business service, you can use JDeveloper 11g to create a JAX-RPC based web service. The following steps guide you through the process.

To select JAX-RPC as the standard for a published business service:

  1. In JDeveloper, right-click on the appropriate published business service project and select Project Properties.

    The Project Properties window for the selected published business service appears.

  2. In the left-hand side tree structure, select Libraries and Classpath.

    The Libraries and Classpath page appears on the right-hand side of the window.

  3. In the Classpath Entries area, select JAX-RPC Web Services and JAX-RPC Web Logic Client.

  4. Move both JAX-RPC 11 Web Services and JAX-RPC Web Logic Client entries to the top of the page by clicking the Move Up button.

    Clicking the Move Up button moves the entry one level at a time; you may need to click the Move Up button multiple times to move the entries to the top of the page.

  5. Click OK.

  6. On JDeveloper, save the changes that you made to the Libraries and Classpath property of the selected published business service.

To create a JAX-RPC-based web service from a published business service:

  1. In JDeveloper, expand the appropriate published business service project folder.

  2. Right-click on the published business service Manager Java file and select Create Web Service.

    The Create Java Web Service window appears with the Generation Options page available.

  3. On Generation Options, verify the system entered values for the Web Service Name and the Port Name fields.

  4. Click Next to open the Service EndPoint Interface page.

  5. On the Service Endpoint Interface page, select the Autogenerate Service Endpoint Interface option, and verify the system entered value for this option.

  6. Click Next to open the Message Format page.

  7. On Message format, do the following:

    • Ensure the Generate Schema with Qualified elements option is selected.

    • Select Document/Literal from the SOAP Message Format drop-down list.

  8. Click Next to open the Mapping page, and accept the system entered values for the fields.

  9. Click Next to open the Methods page.

  10. On Methods, verify that all of the public methods that are defined for the published business service Manager Java file are listed and selected.

  11. Click Next to open the Choose Service State page.

  12. On Choose Service State, click Next to open the Additional Classes page.

  13. On Additional Classes, click Next to open the Select WLS policies page.

  14. On Select WLS policies, click Next to open the Provide Handler Details page.

  15. On Provide Handler Details, verify the system entered Port and click Next to open the Finish page.

  16. On Finish, click the Finish button to create the web service.

6.6 Testing a Published Business Service Project on the JDeveloper Integrated WebLogic Server

If you used JDeveloper 12c to create a JAX-WS web service for a published business service, you deploy the published business service project to the JDeveloper 12c integrated WebLogic server to test the web service.

If you used JDeveloper 11g to create a JAX-RPC or JAX-WS web service for a published business service, you deploy the published business service project to the JDeveloper 11g integrated WebLogic server to test the web service.

6.6.1 Creating a Deployment Profile for the Published Business Service Project

Before you deploy the published business service project to the Integrated WebLogic server, you must create a deployment profile. You use JDeveloper to create a deployment profile for the published business service project.

To create a deployment profile:

  1. On JDeveloper, right-click on the appropriate published business service project and select Project Properties.

  2. On Project Properties, select the published business service project in the Development Profiles area, and then click Edit.

  3. On Edit WAR Deployment Profile Properties, in the tree structure, open File Groups, then open WEB-INF/classes, and then select Contributors.

  4. In the Contributors pane, select these options:

    • Project Output Directory

    • Project Dependencies

      In the Order of Contributors area, ensure that the EnterpriseOne install path (E1_Install_Path\PathCode\ini\sbf) appears, as shown in this example:

      C:\e900\DV900\ini\sbf
      
  5. In the tree structure WEB-INF/classes file group, select Filters.

  6. In the Filters pane, select the Files tab and verify the following

    • All preconfigured EnterpriseOne ini files are selected.

    • In the oracle folder, the published business service and all business service projects on which the published business service is dependent are selected.

  7. In the tree structure, open the WEB-INF/lib file group, and select Contributors.

  8. On the Contributors page, select SBFProjects in the Libraries Selected for Deployment area.

  9. In the tree structure WEB/INF/lib file group, select Filters.

  10. In the Filters page, select the Patterns tab and ensure that all of the EnterpriseOne tools foundation JAR files that are required for the business service are selected.

  11. In the tree structure, select the Library Dependencies group file.

  12. In the Library Dependencies page, ensure that all of the libraries under the Libraries Selected for Deployment area are selected.

  13. In the tree structure, open the Platform group file.

  14. In the Platform page, select IntegratedWebLogicServer from the Target Connection drop-down list.

  15. Click OK on the Edit WAR Deployment Profile properties window.

  16. On the Deployment window, click OK.

  17. On JDeveloper, select the published business services project and click Save on the File menu.

6.6.2 Deploying the Published Business Service Project to the Integrated WebLogic Server

After you create the deployment profile, deploy the published business service project to the integrated WebLogic server.

To deploy the published business service project to the Integrated WebLogic server:

  1. Start the Integrated WebLogic server.

  2. On JDeveloper, right-click on the appropriate published business service project, select Deploy, and then select <published business service project> to deploy to IntegratedWebLogicServer.

  3. Ensure deployment of the published business service project is successful by verifying the Deployment Finished message that appears in the Deployment-Log window in the Deployment tab in JDeveloper.

6.6.3 Testing the Deployed Published Business Service

After you successfully deploy the JAX-RPC or JAX-WS-based published business service to the integrated WebLogic server, you test it. You can use one of these two URLs to access the WebLogic Server Administration Console:

  • http://localhost:7101/console/login/Loginform.jsp

  • http://IPorMachineNameofJdev:7101/console/login/Loginform.jsp

To test the JAX-RPC or JAX-WS-based published business service on the Integrated WebLogic server:

  1. Access and log in to the Integrated WebLogic Server Admin Console.

  2. In left-hand pane on the Integrated WebLogic Server Admin console, in the Domain Structure area, open the Environment domain and then select Servers, Default Server, Deployments.

    The Settings for Default Server page appears on the right-hand side of the admin console.

  3. Select the Deployments tab.

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

  5. Expand the Web Services name, and click on your web service; an example web service name is RI_AddressBookManagerService.

    The Settings for the named web service page appears on the right-hand side of the admin console.

  6. Select the Testing tab.

    The Deployment Tests page appears on the right-hand side of the admin console.

  7. In the Deployments Tests area, click the Test_client link in the Test Point column.

    On the WebLogic Test client tab, the operations for the web service appears.

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

    For example to invoke the getAddressBook operation of the RI_AddressBookManager web service, modify the request document as follows, and then click the getAddressBook button.

    <getAddressBook xmlns="http://oracle.e1.bssv.JPR01000/">  
        <entity xmlns="">
            <entityId>4242</entityId>    
        </entity>  
    </getAddressBook>
    
  9. On the Service Response, verify the test was successful.

When testing the JAX-RPC or JAX-WS published business service, you can configure these 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 BSSV 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
    

Tip:

If your target web service is behind OHS 12.1.3, then add the following setting to your SOAPUI.
C:\Documents and Settings\USER_PROFILE\Application Data\JDeveloper\system11.1.1.*\DefaultDomain\servers\DefaultServer\logs

6.7 Understanding MTOM-Based Media Object Web Services

With Java API for XML-Based Web Services (JAX-WS), you can send binary attachments such as images or files along with web services requests. JAX-WS adds support for optimized transmission of binary data as specified by SOAP MTOM. MTOM is the W3C Message Transmission Optimization Mechanism, a method for sending binary data to and from web services. Media Object published business services leverage the MTOM specification to transmit media objects as binary data in SOAP messages.

6.7.1 Creating a Media Object Web Service in JDeveloper

The steps to create a Media Object web service are the same as creating a JAX-WS web service in JDeveloper. However, you need to select the Enable MTOM check box in the Message Format page. See Creating a JAX-WS Web Service in JDeveloper in this guide for detailed steps.

Both JDeveloper 11g and JDeveloper 12c support creating media object web services.

6.7.2 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 6-1 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 6-2 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 6-3 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