Configuring the Web Service Proxy with a Softcoding Record

When adding code to configure the web service proxy with the softcoding record, you must add import statements to the XML document that was created by the softcoding record application. This code sample shows import statements for the business service:

import oracle.e1.bssvfoundation.util.SoftCodingRecordAccess;
import org.w3c.dom.Element;
import javax.xml.rpc.Stub;
import oracle.e1.bssvfoundation.exception.InvalidSoftCodingRecordException;

Next, you use the getSoftCodingRecord API to retrieve the softcoding record. The following sample code shows how to retrieve the softcoding record, where SAMPLE_KEY is the key that is used to retrieve the record:

Element softCodingRecord =
     SoftCodingRecordAccess.getSoftCodingRecord(context,"SAMPLE_KEY");

The getSoftcodingRecord API throws these two exceptions:

  • SoftCodingRecordAccessException

  • InvalidSoftcodingRecord Exception.

The API throws a SoftCodingRecordAccessException when a system error occurs during the retrieval of the softcoding record from the JD Edwards EnterpriseOne database. The API throws an InvalidSoftCodingRecordException when the softcoding record is not well-formed, causing a parsing error to occur when the API is converting the softcoding record into a document object model (DOM).

The last step in the process is to configure the web service proxy with the softcoding record. Be sure to check for a null condition before setting the softcoding record. The retrieved softcoding record is null if a softcoding record does not exist for the key. The following sample code shows how to check for a null condition, where the key is SAMPLE_KEY:

myPort = new WeatherForecastSoapClient();
if (softCodingRecord!= null)
{

((Stub)myPort.getPort())._setProperty(oracle.webservices.ClientConstants.CLIENT
                                     _CONFIG,softCodingRecord);
}

The EnterpriseOne SoftCoding (E1SC) code template is available in JDeveloper for inserting generated code in the business service. To place the template code into the source editor of JDeveloper, type E1SC and press the accelerator (Ctrl+Enter). This will also bring in any associated imports.