This chapter describes how to use the Oracle Communications Pricing Design Center (PDC) Web service to create or modify the pricing components in PDC using the pricing components that are created or modified in an external application.
You should have a basic understanding of the following:
PDC. See "About Pricing Design Center" for more information.
Product offerings. See "About Creating Product Offerings" for more information.
To use the PDC Web service, you should be familiar with Web services and Oracle WebLogic Server. See your Oracle WebLogic Server documentation for more information.
You should also be familiar with the following:
Extensible markup language (XML) programming
XML schema definition (XSD)
The PDC Web service application programming interface (API) allows other Oracle applications as well as third-party applications to interact with PDC. The PDC Web service API enables you to create or modify the pricing components in PDC using the pricing components that are created or modified in an external application.
To use the PDC Web service API to create or modify the pricing components in PDC, the external application must call the PDC Web service API through a custom client application. You can use any language that supports Web services to access the API; for example, Java.
To use the PDC Web service, you must:
Ensure that the SSL port for the WebLogic Server domain is enabled. See the discussion about enabling the SSL port for the WebLogic Server domain in PDC Installation and System Administration Guide for more information.
Ensure that the following system properties are set in WebLogic Server:
weblogic.security.TrustKeyStore
weblogic.security.CustomTrustKeyStoreFileName
weblogic.security.CustomTrustKeyStorePassPhrase
weblogic.security.CustomTrustKeyStoreType
See the discussion about setting the system properties in the WebLogic Server Administration Console Help for more information.
Ensure that the following BindingProvider properties are set in WebLogic Server:
BindingProvider.USERNAME_PROPERTY
BindingProvider.PASSWORD_PROPERTY
See the discussion about setting the BindingProvider properties in the WebLogic Server Administration Console Help for more information.
Creating or modifying pricing components by using the PDC Web service involves:
Creating the XML file containing the pricing components. See "About Creating the XML Files" for more information.
Using the PDC Web service to create new pricing components or modify the promoted pricing components as defined in the XML file in PDC. See "About Using the PDC Web Service to Create or Modify Pricing Components" for more information.
You create the XML file containing the pricing components in an XML editor or a text editor.
You can create:
One consolidated XML file containing all the pricing components
Separate XML files for each type of pricing component (for example, charge offers, discount offers, packages, and so on)
The XML files that you create must conform to the format detailed in the XSD files for pricing components.
The PDC Web service uses the PricingGateway.xsd file for creating or modifying pricing components in PDC. The XSD files describe the structure of the XML document. The XML file you create must comply with the structure defined in the XSD. The PricingGateway.xsd file is available at:
http://hostName:sslPortNumber/pdc/PricingGatewayPort?xsd=1
where:
hostName is the host name of the machine on which PDC is deployed.
sslPortNumber is the SSL port number of the domain on which PDC is deployed.
The PDC APIs are exposed as Web service operations through the PricingGateway.wsdl file. The PricingGateway.wsdl file defines the Web service that can be called as well as the attributes required to call a specific operation.
You can use the PDC Web service to do the following:
Create the pricing components defined in an XML file in PDC. See "CreatePricing" for more information.
Modify the promoted pricing components in PDC as defined in an XML file. See "ModifyPricing" for more information.
Create the pricing components defined in an XML file in PDC and publish the pricing components to a billing system, such as Oracle Communications Billing and Revenue Management (BRM). See "CreatePricingAndSubmit" for more information.
Modify the promoted pricing components in PDC as defined in an XML file and publish the pricing components to a billing system. See "ModifyPricingAndSubmit" for more information.
Use the following sample code to call the PDC Web service:
PricingGatewayPortType pricingGatewayPortType =(PricingGatewayPortType)Service.getPort(new QName("urn:PricingGateWay","PricingGatewayPort"), PricingGatewayPortType.class); Map<String, Object> rc = ((BindingProvider)pricingGatewayPortType).getRequestContext(); rc. put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, http://hostName:sslPortNumber/pdc/PricingGatewayPort?WSDL)); rc.put(BindingProvider.USERNAME_PROPERTY,pdcUserName); rc.put(BindingProvider.PASSWORD_PROPERTY,pdcUserPassword); UserContextType userContext = new UserContextType(); userContext.setUserid("pdcUserName"); PricingInputXMLType pricingInputXMLType = new PricingInputXMLType(); pricingInputXMLType.setUserContext(userContext); ByteArrayOutputStream bs = new ByteArrayOutputStream(); ZipOutputStream out = new ZipOutputStream(bs); FileInputStream fl = null; try { fl = new FileInputStream(new File(pricing.xml)); // Set the compression ratio out.setLevel(Deflater.BEST_COMPRESSION); ZipEntry ze = new ZipEntry(PDC); out.putNextEntry(ze); byte[] data = new byte[BUFFER_SIZE]; int count = 0; BufferedInputStream in = new BufferedInputStream(fl); while ((count = in.read(data, 0, BUFFER_SIZE)) != -1){ out.write(data, 0, count); } } catch (Exception e) { throw e; } finally { if (fl != null) { fl.close(); } if (bs != null) { bs.flush(); } if (out != null) { out.flush(); out.close(); } } byte[] bytesToRet = null; if (bs != null) { bytesToRet = bs.toByteArray(); } pricingInputXMLType.setXmlBinaryString(bytesToRet); PDCResponseType pDCResponseType = pricingGatewayPortType.createPricingAndSubmit(pricingInputXMLType);
This Web service operation validates the input XML by comparing the XML fields and values against the values in the PricingGateway.xsd file and the rules for each type of pricing component. If the validation is successful, it retrieves the data from the XML file and creates the pricing components in PDC.
The CreatePricing operation does not publish the pricing components to a billing system.
public oracle.communications.brm.pdc.server.service.types.PDCResponseType createPricing(oracle.communications.brm.pdc.server.service.types.PricingInputXMLType param) throws oracle.communications.brm.pdc.server.service.PricingExceptionResponse;
This Web service operation validates the input XML by comparing the XML fields and values against the values in the PricingGateway.xsd file and the rules for each type of pricing component. If the validation is successful, it retrieves the data from the XML file and updates the existing pricing components in PDC.
The ModifyPricing operation does not publish the pricing components to a billing system.
public oracle.communications.brm.pdc.server.service.types.PDCResponseType modifyPricing(oracle.communications.brm.pdc.server.service.types.PricingInputXMLType param) throws oracle.communications.brm.pdc.server.service.PricingExceptionResponse;
This Web service operation validates the input XML by comparing the XML fields and values against the values in the PricingGateway.xsd file and the rules for each type of pricing component. If the validation is successful, it retrieves the data from the XML file, creates the pricing components in PDC, and publishes the pricing components to the billing system.
public oracle.communications.brm.pdc.server.service.types.PDCResponseType createPricingAndSubmit(oracle.communications.brm.pdc.server.service.types.PricingInputXMLType param) throws oracle.communications.brm.pdc.server.service.PricingExceptionResponse;
This Web service operation validates the input XML by comparing the XML fields and values against the values in the PricingGateway.xsd file and the rules for each type of pricing component. If the validation is successful, it retrieves the data from the XML file, updates the existing pricing components in PDC, and publishes the pricing components to the billing system.
public oracle.communications.brm.pdc.server.service.types.PDCResponseType modifyPricingAndSubmit(oracle.communications.brm.pdc.server.service.types.PricingInputXMLType param) throws oracle.communications.brm.pdc.server.service.PricingExceptionResponse;