6 Using Web Services

This chapter contains information about using Oracle Communications Billing and Revenue Management (BRM) Web Services Manager.

Before reading this chapter, you should be familiar with implementing web services.

About WSDL Files and BRM Opcodes

Web Services Manager exposes BRM opcodes as operations through different web services.

The web services included in Web Services Manager define the opcodes that can be called as Web service APIs and the attributes required to call a specific opcode. The Web service APIs (opcodes) are grouped by functional area into a Web service. For example, the BRMBillServices Web service defines the billing Web service APIs, and the BRMPymtServices Web service defines the payment Web service APIs. Web Services Manager includes one WSDL file for each Web service.

Web Services Manager contains different WSDL files for web services that supports XML string payload and for web services that supports XML element payload.

For example:

  • The BRMBalService web service defines balances web service APIs that supports XML string payload.

  • The BRMBalService_v2 web service defines balances web service APIs that supports XML element payload. The file names of WSDL files for web services that supports XML element payload contain _v2 as a suffix.

Note:

The WSDL files and schema (XSD) files for web services that supports XML string payload are included in the infranetwebsvc.war file. If you customize any web services, copy the customized schema files and WSDL files to the infranetwebsvc.war file. The WSDL files and schema (XSD) files for web services that supports XML element payload are included in the BrmWebServices.war file. If you customize any web services, copy the customized schema files and WSDL files to the BrmWebServices.war file.

WSDLs with XML String Payload

Table 6-1 describes the web services included in Web Services Manager that supports XML string payload.

Table 6-1 Web Services Included in Web Services Manager that Supports XML String Payload

Web Service Name Description

BRMARServices

Defines the accounts receivable web service, which includes the following opcodes:

  • PCM_OP_AR_ACCOUNT_ADJUSTMENT

  • PCM_OP_AR_BILL_ADJUSTMENT

  • PCM_OP_AR_GET_ACCT_ACTION_ITEMS

  • PCM_OP_AR_GET_ACCT_BAL_SUMMARY

  • PCM_OP_AR_GET_ACCT_BILLS

  • PCM_OP_AR_GET_BAL_SUMMARY

  • PCM_OP_AR_GET_BILL_ITEMS

  • PCM_OP_AR_ITEM_ADJUSTMENT

  • PCM_OP_AR_EVENT_ADJUSTMENT

  • PCM_OP_AR_GET_ACTION_ITEMS

  • PCM_OP_AR_GET_BILLS

  • PCM_OP_AR_RESOURCE_AGGREGATION

See "Accounts Receivable FM Standard Opcodes" in BRM Developer's Reference for more information.

BRMBalServices

Defines the balances web service, which includes the following opcodes:

  • PCM_OP_BAL_GET_BALANCES

  • PCM_OP_BAL_GET_BAL_GRP_AND_SVC

  • PCM_OP_BAL_GET_ACCT_BAL_GRP_AND_SVC

  • PCM_OP_BAL_GET_ACCT_BILLINFO

See "Balance FM Standard Opcodes" in BRM Developer's Reference for more information.

BRMBillServices

Defines the billing web service, which includes the following opcodes:

  • PCM_OP_BILL_GET_ITEM_EVENT_CHARGE_DISCOUNT

  • PCM_OP_BILL_GROUP_MOVE_MEMBER

  • PCM_OP_BILL_MAKE_BILL_NOW

  • PCM_OP_BILL_DEBIT

  • PCM_OP_BILL_GROUP_GET_PARENT

See "Billing FM Standard Opcodes" in BRM Developer's Reference for more information.

BRMCollectionsServices

Defines the collections web service, which includes the following opcode:

  • PCM_OP_COLLECTIONS_SET_ACTION_STATUS

See "Collections Manager FM Standard Opcodes" in BRM Developer's Reference for more information.

BRMCustcareServices

Defines the customer care web service, which includes the following opcode:

  • PCM_OP_CUSTCARE_MOVE_ACCT

See "Customer Care FM Standard Opcodes" in BRM Developer's Reference for more information.

BRMCustServices

Defines the customer web service, which includes the following opcodes:

  • PCM_OP_CUST_COMMIT_CUSTOMER

  • PCM_OP_CUST_MODIFY_CUSTOMER

  • PCM_OP_CUST_UPDATE_CUSTOMER

  • PCM_OP_CUST_UPDATE_SERVICES

  • PCM_OP_CUST_DELETE_ACCT

  • PCM_OP_CUST_DELETE_PAYINFO

  • PCM_OP_CUST_CREATE_PROFILE

  • PCM_OP_CUST_MODIFY_PROFILE

  • PCM_OP_CUST_DELETE_PROFILE

See "Customer FM Standard Opcodes" in BRM Developer's Reference for more information.

BRMInvServices

Defines the invoicing web service, which includes the following opcode:

  • PCM_OP_INV_VIEW_INVOICE

Important: You must configure your client application to convert the invoice data received from the PCM_OP_INV_VIEW_INVOICE opcode into the appropriate format. See "About Invoicing Output XML Data" in BRM JCA Resource Adapter.

See "Invoicing FM Standard Opcodes" in BRM Developer's Reference for more information.

BRMPricesServices

Defines the prices web service, which includes the following opcodes:

  • PCM_OP_PRICE_COMMIT_PRODUCT

  • PCM_OP_PRICE_COMMIT_DISCOUNT

  • PCM_OP_PRICE_SET_PRICE_LIST

  • PCM_OP_PRICE_GET_PRICE_LIST

See "Price List FM Standard Opcodes" in BRM Developer's Reference for more information.

BRMPymtServices

Defines the payment web service, which includes the following opcode:

  • PCM_OP_PYMT_COLLECT

See "Payment FM Standard Opcodes" in BRM Developer's Reference for more information.

BRMReadServices

Defines the read web service, which includes the following opcodes:

  • PCM_OP_READ_FLDS

  • PCM_OP_READ_OBJ

  • PCM_OP_SEARCH

See "LDAP Base Opcodes" in BRM Developer's Reference for more information.

BRMSubscriptionServices

Defines the subscription web service, which includes the following opcodes:

  • PCM_OP_SUBSCRIPTION_CANCEL_PRODUCT

  • PCM_OP_SUBSCRIPTION_CANCEL_DISCOUNT

  • PCM_OP_SUBSCRIPTION_CANCEL_SUBSCRIPTION

  • PCM_OP_SUBSCRIPTION_CHANGE_DEAL

  • PCM_OP_SUBSCRIPTION_PURCHASE_DEAL

  • PCM_OP_SUBSCRIPTION_SET_BUNDLE

  • PCM_OP_SUBSCRIPTION_SET_DISCOUNT_STATUS

  • PCM_OP_SUBSCRIPTION_SET_DISCOUNTINFO

  • PCM_OP_SUBSCRIPTION_SET_PRODINFO

  • PCM_OP_SUBSCRIPTION_SET_PRODUCT_STATUS

  • PCM_OP_SUBSCRIPTION_TRANSFER_SUBSCRIPTION

  • PCM_OP_SUBSCRIPTION_GET_PURCHASED_OFFERINGS

See "Subscription Management FM Standard Opcodes" in BRM Developer's Reference for more information.


WSDLs with XML Element Payload

Web services that support XML element payload describe the input in a well-defined structure. Any standards-compliant SOAP development application can generate a client stub. The WSDL files of these web services describe the input as a well-defined message.

Table 6-2 describes the web services included in Web Services Manager that support XML element payload.

Table 6-2 Web Services Included in Web Services Manager that Support XML Element Payload

Web Service Name Description

BRMACTServices_v2

Defines the activity web service, which includes the following opcodes:

  • PCM_OP_ACT_ACTIVITY

  • PCM_OP_ACT_CALC_MAX_USAGE

  • PCM_OP_ACT_FIND

  • PCM_OP_ACT_LOAD_SESSION

See "Activity FM Standard Opcodes" in BRM Developer's Reference for more information.

BRMARServices_v2

Defines the accounts receivable web service, which includes the following opcodes:

  • PCM_OP_AR_ACCOUNT_ADJUSTMENT

  • PCM_OP_AR_ACCOUNT_WRITEOFF

  • PCM_OP_AR_BILL_ADJUSTMENT

  • PCM_OP_AR_BILL_DISPUTE

  • PCM_OP_AR_BILL_SETTLEMENT

  • PCM_OP_AR_BILL_WRITEOFF

  • PCM_OP_AR_BILLINFO_WRITEOFF

  • PCM_OP_AR_EVENT_ADJUSTMENT

  • PCM_OP_AR_EVENT_DISPUTE

  • PCM_OP_AR_EVENT_SETTLEMENT

  • PCM_OP_AR_GET_ACCT_ACTION_ITEMS

  • PCM_OP_AR_GET_ACCT_BAL_SUMMARY

  • PCM_OP_AR_GET_ACCT_BILLS

  • PCM_OP_AR_GET_ACTION_ITEMS

  • PCM_OP_AR_GET_BAL_SUMMARY

  • PCM_OP_AR_GET_BILLS

  • PCM_OP_AR_GET_BILL_ITEMS

  • PCM_OP_AR_GET_DISPUTES

  • PCM_OP_AR_GET_DISPUTE_DETAILS

  • PCM_OP_AR_GET_ITEMS

  • PCM_OP_AR_GET_ITEM_DETAILS

  • PCM_OP_AR_ITEM_ADJUSTMENT

  • PCM_OP_AR_ITEM_DISPUTE

  • PCM_OP_AR_ITEM_SETTLEMENT

  • PCM_OP_AR_ITEM_WRITEOFF

  • PCM_OP_AR_RESOURCE_AGGREGATION

See "Accounts Receivable FM Standard Opcodes" in BRM Developer's Reference for more information.

BRMBALServices_v2

Defines the balances web service, which includes the following opcodes:

  • PCM_OP_BAL_CHANGE_VALIDITY

  • PCM_OP_BAL_GET_BALANCES

  • PCM_OP_BAL_GET_BAL_GRP_AND_SVC

  • PCM_OP_BAL_GET_ACCT_BAL_GRP_AND_SVC

  • PCM_OP_BAL_GET_ACCT_BILLINFO

See "Balance FM Standard Opcodes" in BRM Developer's Reference for more information.

BRMBILLServices_v2

Defines the billing web service, which includes the following opcodes:

  • PCM_OP_BILL_DEBIT

  • PCM_OP_BILL_FIND

  • PCM_OP_BILL_GET_ITEM_EVENT_CHARGE_DISCOUNT

  • PCM_OP_BILL_GROUP_GET_PARENT

  • PCM_OP_BILL_GROUP_MOVE_MEMBER

  • PCM_OP_BILL_ITEM_EVENT_SEARCH

  • PCM_OP_BILL_ITEM_REFUND

  • PCM_OP_BILL_MAKE_BILL_NOW

  • PCM_OP_BILL_REVERSE

  • PCM_OP_BILL_SET_LIMIT_AND_CR

  • PCM_OP_BILL_VIEW_INVOICE

See "Billing FM Standard Opcodes" in BRM Developer's Reference for more information.

BRMCOLLECTIONSServices_v2

Defines the collections web service, which includes the following opcode:

  • PCM_OP_COLLECTIONS_SET_ACTION_STATUS

See "Collections Manager FM Standard Opcodes" in BRM Developer's Reference for more information.

BRMCUSTCAREServices_v2

Defines the customer care web service, which includes the following opcode:

  • PCM_OP_CUSTCARE_MOVE_ACCT

See "Customer Care FM Standard Opcodes" in BRM Developer's Reference for more information.

BRMCUSTServices_v2

Defines the customer web service, which includes the following opcodes:

  • PCM_OP_CUST_COMMIT_CUSTOMER

  • PCM_OP_CUST_CREATE_PROFILE

  • PCM_OP_CUST_DELETE_ACCT

  • PCM_OP_CUST_DELETE_PAYINFO

  • PCM_OP_CUST_DELETE_PROFILE

  • PCM_OP_CUST_FIND

  • PCM_OP_CUST_FIND_PAYINFO

  • PCM_OP_CUST_FIND_PROFILE

  • PCM_OP_CUST_GET_NOTE

  • PCM_OP_CUST_MODIFY_CUSTOMER

  • PCM_OP_CUST_MODIFY_PROFILE

  • PCM_OP_CUST_SET_NOTE

  • PCM_OP_CUST_SET_STATUS

  • PCM_OP_CUST_SET_TAXINFO

  • PCM_OP_CUST_UPDATE_CUSTOMER

  • PCM_OP_CUST_UPDATE_SERVICES

See "Customer FM Standard Opcodes" in BRM Developer's Reference for more information.

  • PCM_OP_CUST_POL_GET_PLANS

  • PCM_OP_CUST_POL_GET_DEALS

  • PCM_OP_CUST_POL_GET_PRODUCTS

  • PCM_OP_CUST_POL_READ_PLAN

See "Customer FM Policy Opcodes" in BRM Developer's Reference for more information.

BRMINVServices_v2

Defines the invoicing web service, which includes the following opcode:

  • PCM_OP_INV_VIEW_INVOICE

Important: You must configure your client application to convert the invoice data received from the PCM_OP_INV_VIEW_INVOICE opcode into the appropriate format. See "About Invoicing Output XML Data" in BRM JCA Resource Adapter.

See "Invoicing FM Standard Opcodes" in BRM Developer's Reference for more information.

BRMPRICESServices_v2

Defines the prices web service, which includes the following opcodes:

  • PCM_OP_PRICE_COMMIT_PRODUCT

  • PCM_OP_PRICE_COMMIT_DISCOUNT

  • PCM_OP_PRICE_SET_PRICE_LIST

  • PCM_OP_PRICE_GET_DISCOUNT_INFO

  • PCM_OP_PRICE_GET_PRICE_LIST

  • PCM_OP_PRICE_GET_PRODUCT_INFO

See "Price List FM Standard Opcodes" in BRM Developer's Reference for more information.

BRMPYMTServices_v2

Defines the payment web service, which includes the following opcode:

  • PCM_OP_PYMT_COLLECT

See "Payment FM Standard Opcodes" in BRM Developer's Reference for more information.

BRMREADServices_v2

Defines the read web service, which includes the following opcodes:

  • PCM_OP_READ_FLDS

  • PCM_OP_READ_OBJ

  • PCM_OP_SEARCH

  • PCM_OP_TEST_LOOPBACK

See "LDAP Base Opcodes" in BRM Developer's Reference for more information.

BRMSUBSCRIPTIONServices_v2

Defines the subscription web service, which includes the following opcodes:

  • PCM_OP_SUBSCRIPTION_CANCEL_DEAL

  • PCM_OP_SUBSCRIPTION_CANCEL_PRODUCT

  • PCM_OP_SUBSCRIPTION_CANCEL_DISCOUNT

  • PCM_OP_SUBSCRIPTION_CANCEL_SUBSCRIPTION

  • PCM_OP_SUBSCRIPTION_CHANGE_DEAL

  • PCM_OP_SUBSCRIPTION_GET_HISTORY

  • PCM_OP_SUBSCRIPTION_PURCHASE_DEAL

  • PCM_OP_SUBSCRIPTION_PURCHASE_FEES

  • PCM_OP_SUBSCRIPTION_READ_ACCT_PRODUCTS

  • PCM_OP_SUBSCRIPTION_SERVICE_BALGRP_TRANSFER

  • PCM_OP_SUBSCRIPTION_SET_BUNDLE

  • PCM_OP_SUBSCRIPTION_SET_DISCOUNT_STATUS

  • PCM_OP_SUBSCRIPTION_SET_DISCOUNTINFO

  • PCM_OP_SUBSCRIPTION_SET_PRODINFO

  • PCM_OP_SUBSCRIPTION_SET_PRODUCT_STATUS

  • PCM_OP_SUBSCRIPTION_TRANSFER_SUBSCRIPTION

  • PCM_OP_SUBSCRIPTION_TRANSITION_DEAL

  • PCM_OP_SUBSCRIPTION_TRANSITION_PLAN

  • PCM_OP_SUBSCRIPTION_GET_PURCHASED_OFFERINGS

See "Subscription Management FM Standard Opcodes" in BRM Developer's Reference for more information.


Finding WSDL V2 Files

The file names of WSDL files for web services that supports XML element payload contain _v2 as a suffix.

To locate the WSDL V2 files:

  1. Go to the BRM_home/deploy/web_services directory.

  2. Unpack the infranetwebsvc.war file:

    jar -xvf infranetwebsvc.war
    

    The WEB-INF/services directory is created.

  3. Go to the BRM_home/deploy/web_services/WEB-INF/services directory.

  4. Unpack the InfranetWebservices.aar file:

    jar -xvf InfranetWebservices.aar
    

    All WSDL V2 files are unpacked into the BRM_home/deploy/web_services/WEB-INF/services/MET-INF directory.

About Validating Input and Output XML Data

Web Services Manager validates the input and output XML by comparing the XML fields and values against the opcode XML schema.

The opcode specifications, schemas, and WSDL files are packaged along with Web Services Manager. The package includes the opspec.xsd file and the pin_opspec_to_schema utility. Use the opspec.xsd file to write opcode specifications for custom opcodes that need to be exposed as a Web service. Use the pin_opspec_to_schema utility to generate the schema files from the opcode specification files.

To configure Web Services Manager to validate the input and output XML against the target opcode XML schema:

  1. Open the local_dir/WEB-INF/classes/Infranet.properties file.

  2. Add the following entries to the file:

    • webservices.input.validation.enabled=true

    • webservices.output.validation.enabled=true

  3. Do one of the following:

    • If you are using Oracle WebLogic Server, copy the schema files packaged as a part of Web Services Manager installation from the BRM_home/deploy/web_services/schemas directory to the local_dir/common/lib directory.

    • If you are using any supported server, copy the schema files from the BRM_home/deploy/web_services/schemas directory to the local_dir/WEB-INF/classes directory.

About Developing and Testing Client Applications with Web Services Manager

You can develop custom applications that interact with BRM through Web Services Manager. Use a SOAP development environment that supports importing WSDL files, for example SoapUI, to develop and test your custom Web service applications. SOAP development applications may have minor differences in product configuration. Consult your SOAP development application documentation for configuration information.

In general, do the following to develop and test your web services applications:

  1. Download and install a SOAP development application.

  2. Configure a new project in your SOAP development application.

  3. Write a client application that communicates with web services using the SOAP protocol.

  4. Import the Web service definitions using the WSDL files. See "About WSDL Files and BRM Opcodes" for more information on accessing WSDL files.

  5. Run the required commands to set up your application server environment.

  6. Configure the properties of the web services operations in your SOAP development environment with valid credentials.

  7. Send a Web service request to BRM from the SOAP development environment client.

  8. View the Web service response in the SOAP development environment.

Example of a Testing a Web Services Implementation Using a Client Application

To test your web services implementation, write a client application that communicates with the Web service using the SOAP protocol.

The sample procedures use WebLogic Server, but you can apply the concepts to any other supported application server.

This sample procedure demonstrates how to use the TestClient.java sample code with the PCM_OP_TEST_LOOPBACK opcode to verify communication between BRM and the Web service.

To test your web services implementation using a client application:

  1. Set up the WebLogic Server environment by running one of the following commands:

    • On UNIX: WebLogic_home/wlserver/server/bin/setWLSEnv.sh

    • On Windows: WebLogic_home/server/bin/setenv.exe

      where WebLogic_home is the directory in which WebLogic Server is installed.

  2. Create an XML file (some_name_1.xml) using the following text:

    <project name="buildWebservice" default="all">
    <property name="buildDir" value="./myapps" />
    <property name="jarFiles" value="jars" />
    <target name="all" depends="jar" description="builds everything">
    </target>
    <target name="generate-client">
    <clientgen wsdl="http://198.51.100.1:7001/infranetwebsvc/services/Infranet?wsdl"       
    packageName="test_client"  
    destDir= "./myapps"/>       
    </target>
    <target name="compile" depends="generate-client" description="compile source files">
        <echo> Compiling adapter files</echo>
        <javac  destdir="${buildDir}">
            <src path="${buildDir}"/>
        </javac>
    </target>
    <target name="jar" depends="compile" description="generate jar file(s)">
        <jar jarfile="clientStub.jar"  basedir="${buildDir}">
        <exclude name = "**/*.java"/>
    
        </jar>
    </target>
    <target name="clean" description="remove files created by target prepare">
        <delete dir="${buildDir}"/>
    </target>
    </project>
    

    This XML file uses the WebLogic Server clientgen task to automatically generate a utility library that provides low-level SOAP communication (client stubs).

  3. Run the following command, which creates the client stubs:

    ant -file some_name_1.xml
    

    This process generates the clientstubs.jar file, which contains stubs used by the client. The test client code (Source_home/TestClient.java, where Source_home is the directory in which your source code files are stored) then creates an flist, converts it to XML, and calls the PCM_OP_TEST_LOOPBACK opcode.

    The following is a sample listing of TestClient.java:

    import java.io.IOException;
    import test_client.*;  // corresponds to package name clientgen generated 
    
    public class TestClient {
    
        public static void main(String[] args) {
            try {
    
                String wsdlUrl = 
    "http://198.51.100.1:7001/infranetwebsvc/services/Infranet?wsdl"; 
                InfranetWebServiceService service = new InfranetServiceService_Impl( wsdlUrl );
                InfranetWebService port = service.getInfranet();
    
                // convert flist to XML representation
                String XMLInput="<flist xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><POID>0.0.0.1 /account 80408 8</POID></flist>";
                System.out.println("Input: " + XMLInput);
                // invoke web service &rsquor;opcode' method
                String result = port.opcode("TEST_LOOPBACK", XMLInput);
        
                System.out.println("result: "+ result);
    
            } catch (Exception ex) {
                ex.printStackTrace();    
            }
        }
    }
    
    
  4. Create another XML file (some_name_2.xml) using the following text:

    Note:

    Replace the paths for the JAR files as required.
    <project name="test_client" default="all">
    
    <target name="all" depends="run"/>
    
    <path id="classpath">
        <pathelement path="clientstubs.jar"/>
        <pathelement path=".\classes"/>
        <pathelement path="D:\WebServices\webman\lib\jaxrpc.jar"/>
        <pathelement path="D:\bea\wlserver_10.3\server\lib\wseeclient.jar"/>
        <pathelement path="D:\bea\wlserver_10.3\server\lib\weblogic.jar"/>
    </path>
    
    c
    <target name="compile">
        <mkdir dir="classes"/>
        <javac  srcdir="src" 
            destdir="classes"
            classpathref="classpath"
        />
    </target>
    
    <target name="run" depends="compile">
        <java classname="TestClient"
                fork="yes"
                classpathref="classpath">
        </java>
    </target>
    
    </project>    
    
  5. Build and run the test with the some_name_2.xml file using regular Ant tasks:

    ant -file some_name_2.xml
    

Testing the Web Service

To test your web services implementation, use a SOAP development application that supports importing WSDL files: for example, SoapUI. SOAP development applications may have minor differences in project configuration. Consult your SOAP development environment documentation for configuration information.

To test your web services implementation, write a client application that communicates with the Web service using the SOAP protocol.

Note:

You can test web services using SoapUI version 4.6.3.

The sample procedures use WebLogic Server, but you can apply the concepts to any other supported server.

To test your Web service:

  1. Set up the WebLogic Server environment by running one of the following commands:

    • On UNIX: WebLogic_home/wlserver/server/bin/setWLSEnv.sh

    • On Windows: WebLogic_home/server/bin/setenv.exe

      where WebLogic_home is the directory in which WebLogic Server is installed.

  2. Create an XML file (some_name_1.xml) using the following text:

    <project name="buildWebservice" default="all">
    <property name="buildDir" value="./myapps" />
    <property name="jarFiles" value="jars" />
    <target name="all" depends="jar" description="builds everything">
    </target>
    <target name="generate-client">
    <clientgen wsdl="http://198.51.100.1:7001/infranetwebsvc/services/Infranet?wsdl"       
    packageName="test_client"  
    destDir= "./myapps"/>       
    </target>
    <target name="compile" depends="generate-client" description="compile source files">
        <echo> Compiling adapter files</echo>
        <javac  destdir="${buildDir}">
            <src path="${buildDir}"/>
        </javac>
    </target>
    <target name="jar" depends="compile" description="generate jar file(s)">
        <jar jarfile="clientStub.jar"  basedir="${buildDir}">
        <exclude name = "**/*.java"/>
    
        </jar>
    </target>
    <target name="clean" description="remove files created by target prepare">
        <delete dir="${buildDir}"/>
    </target>
    </project>
    

    This XML file uses the WebLogic Server clientgen task to automatically generate a utility library that provides low-level SOAP communication (client stubs).

  3. Run the following command, which creates the client stubs:

    ant -file some_name_1.xml
    

    This process generates the clientstubs.jar file, which contains stubs used by the client. The test client code (src\TestClient.java) then creates an flist, converts it to XML, and calls the PCM_OP_TEST_LOOPBACK opcode.

    The following is a sample listing of TestClient.java:

    import java.io.IOException;
    import test_client.*;  // corresponds to package name clientgen generated 
    
    public class TestClient {
    
        public static void main(String[] args) {
            try {
    
                String wsdlUrl = 
    "http://198.51.100.1:7001/infranetwebsvc/services/Infranet?wsdl"; 
                InfranetWebServiceService service = new InfranetServiceService_Impl( wsdlUrl );
                InfranetWebService port = service.getInfranet();
    
                // convert flist to XML representation
                String XMLInput="<flist xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><POID>0.0.0.1 /account 80408 8</POID></flist>";
                System.out.println("Input: " + XMLInput);
                // invoke web service &rsquor;opcode' method
                String result = port.opcode("TEST_LOOPBACK", XMLInput);
        
                System.out.println("result: "+ result);
    
            } catch (Exception ex) {
                ex.printStackTrace();    
            }
        }
    }
    
    
  4. Create another XML file (some_name_2.xml) using the following text:

    Note:

    Replace the paths for the JAR files as required.
    <project name="test_client" default="all">
    
    <target name="all" depends="run"/>
    
    <path id="classpath">
        <pathelement path="clientstubs.jar"/>
        <pathelement path=".\classes"/>
        <pathelement path="D:\WebServices\webman\lib\jaxrpc.jar"/>
        <pathelement path="D:\bea\wlserver_10.3\server\lib\wseeclient.jar"/>
        <pathelement path="D:\bea\wlserver_10.3\server\lib\weblogic.jar"/>
    </path>
    
    c
    <target name="compile">
        <mkdir dir="classes"/>
        <javac  srcdir="src" 
            destdir="classes"
            classpathref="classpath"
        />
    </target>
    
    <target name="run" depends="compile">
        <java classname="TestClient"
                fork="yes"
                classpathref="classpath">
        </java>
    </target>
    
    </project>    
    
  5. Build and run the test with the some_name_2.xml file using regular Ant tasks:

    ant -file some_name_2.xml
    

Using Sample Web Services Programs

Web Services Manager includes sample programs that demonstrate how to write code for various tasks when customizing web services. For example, the sample program InfranetBALTestClient.java creates an flist, converts it to XML, and calls the PCM_OP_BAL_GET_BALANCES opcode.

Example of Creating an Account in BRM Using Web Services

This section describes an example of creating a customer account using web services. The example shows a sample SOAP request and a response message for creating a customer account in BRM by calling a Web service in Web Services Manager.

To create an account in BRM using web services, call the pcmOpCustCommitCustomer Web service API which maps to the PCM_OP_CUST_COMMIT_CUSTOMER opcode. The pcmOpCustCommitCustomer Web service API is included in the BRMCUSTServices_v2 Web service. The BRMCUSTServices_v2 Web service contains Web service APIs that are related to customer accounts. See "About WSDL Files and BRM Opcodes" for more information about the web services included in the Web Services Manager package.

You use URLs to create SOAP clients for web services. The URL to create a SOAP client is generated by the JAX-WS in WebLogic Server.

To generate the URL for a Web service:

  1. Log in to WebLogic Server Administration Console.

  2. Go to the Deployments section.

  3. Click the BrmWebServices link.

    The Settings page for the deployment appears and all the web services are listed in the Modules and Components section.

  4. In the Modules and Components section, click the Web service.

  5. Click the Testing tab.

  6. WebLogic Server Administration Console displays a URL for the BRM web services.

A sample URL for the BRMCUSTServices_v2 Web service is as follows:

http://hostIPAddress:port/BrmWebServices/BRMCUSTServices_v2?wsdl

To call a Web service, you are required to authenticate using a valid user name and a password. Users can call only those web services that they are authorized to call.

Sample SOAP Request Input XML File

The following sample shows a SOAP request for the pcmOpCustCommitCustomer Web service API.

- <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bus="http://xmlns.oracle.com/BRM/schemas/BusinessOpcodes">
   <soapenv:Header /> 
 - <soapenv:Body>
  - <bus:pcmOpCustCommitCustomer>
   - <PCM_OP_CUST_COMMIT_CUSTOMER_Request xsi:type="bus:PCM_OP_CUST_COMMIT_CUSTOMER_RequestType">
       <flags xsi:type="xsd:int">1</flags> 
     - <PCM_OP_CUST_COMMIT_CUSTOMER_inputFlist xmlns="http://xmlns.oracle.com/BRM/schemas/BusinessOpcodes">
       - <ACCTINFO elem="0">
           <ACCOUNT_NO>a022020202011992</ACCOUNT_NO> 
           <BAL_INFO /> 
           <BUSINESS_TYPE>1</BUSINESS_TYPE> 
           <CURRENCY>840</CURRENCY> 
           <POID>0.0.0.1 /account -1 0</POID> 
         </ACCTINFO>
     - <BAL_INFO elem="0">
        <BILLINFO /> 
       - <LIMIT elem="840">
          <CREDIT_LIMIT>"0"</CREDIT_LIMIT> 
        </LIMIT>
      <NAME>Account Level Balance Group</NAME> 
      <POID>0.0.0.1 /balance_group -1 0</POID> 
    </BAL_INFO>
 - <BILLINFO elem="0">
     <BAL_INFO /> 
     <BILL_WHEN>1</BILL_WHEN> 
     <BILLINFO_ID>88-CYZZ5</BILLINFO_ID> 
     <CURRENCY>840</CURRENCY> 
     <PAY_TYPE>10001</PAY_TYPE> 
     <PAYINFO /> 
     <POID>0.0.0.1 /billinfo -1 0</POID> 
   </BILLINFO>
   <END_T>2010-02-17T22:37:49</END_T> 
   <FLAGS>0</FLAGS> 
 - <LOCALES elem="1">
     <LOCALE>en_US</LOCALE> 
  </LOCALES>
 - <NAMEINFO elem="1">
     <ADDRESS>123 Hollywood Boulevard</ADDRESS> 
     <CITY>Los Angeles</CITY> 
     <CONTACT_TYPE>Account holder</CONTACT_TYPE> 
     <COUNTRY>USA</COUNTRY> 
     <EMAIL_ADDR>test_001</EMAIL_ADDR> 
     <FIRST_NAME>Chetn3457</FIRST_NAME> 
     <LAST_NAME>Chet8905</LAST_NAME> 
     <STATE>NJ</STATE> 
     <ZIP>90001</ZIP> 
   </NAMEINFO>
 - <PAYINFO elem="0">
      - <INHERITED_INFO>
          - <INV_INFO elem="0">
               <ADDRESS>123 Hollywood Boulevard</ADDRESS> 
               <CITY>Los Angeles</CITY> 
               <COUNTRY>USA</COUNTRY> 
               <DELIVERY_DESCR>test_001</DELIVERY_DESCR> 
               <DELIVERY_PREFER>0</DELIVERY_PREFER> 
               <EMAIL_ADDR /> 
             <INV_TERMS>0</INV_TERMS> 
           <NAME>Chet3457 Chet8905</NAME> 
         <STATE>NJ</STATE> 
       <ZIP>90001</ZIP> 
      </INV_INFO>
     </INHERITED_INFO>
     <INV_TYPE>0</INV_TYPE> 
     <PAY_TYPE>10001</PAY_TYPE> 
     <POID>0.0.0.1 /payinfo/invoice -1 0</POID> 
     </PAYINFO>
     <POID>0.0.0.1 /plan -1 0</POID> 
    </PCM_OP_CUST_COMMIT_CUSTOMER_inputFlist>
   </PCM_OP_CUST_COMMIT_CUSTOMER_Request>
  </bus:pcmOpCustCommitCustomer>
 </soapenv:Body>
</soapenv:Envelope>

Sample SOAP Response Output XML File

The following sample shows a SOAP response message for the pcmOpCustCommitCustomer Web service API.

- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
 - <soapenv:Body>
  - <brm:PCM_OP_CUST_COMMIT_CUSTOMER_outputFlist xmlns:brm="http://xmlns.oracle.com/BRM/schemas/BusinessOpcodes">
     <brm:ACCOUNT_OBJ>0.0.0.1 /account 225757 0</brm:ACCOUNT_OBJ> 
   - <brm:ACCTINFO elem="0">
      <brm:ACCOUNT_NO>a022020202011992</brm:ACCOUNT_NO> 
      <brm:BAL_INFO elem="0" /> 
      <brm:BUSINESS_TYPE>1</brm:BUSINESS_TYPE> 
      <brm:CURRENCY>840</brm:CURRENCY> 
      <brm:POID>0.0.0.1 /account -1 0</brm:POID> 
    </brm:ACCTINFO>
  - <brm:BAL_INFO elem="0">
     <brm:ACCOUNT_OBJ>0.0.0.1 /account 225757 0</brm:ACCOUNT_OBJ> 
     <brm:BILLINFO_OBJ>0.0.0.1 /billinfo 226269 0</brm:BILLINFO_OBJ> 
     - <brm:LIMIT elem="840">
        <brm:CREDIT_LIMIT /> 
      </brm:LIMIT>
      <brm:NAME>Account Level Balance Group</brm:NAME> 
      <brm:POID>0.0.0.1 /balance_group 225341 0</brm:POID> 
      <brm:SERVICE_OBJ>0.0.0.0 0 0</brm:SERVICE_OBJ> 
      </brm:BAL_INFO>
    - <brm:BILLINFO elem="0">
        <brm:BAL_GRP_OBJ>0.0.0.1 /balance_group 225341 0</brm:BAL_GRP_OBJ> 
        <brm:BILLINFO_ID>88-CYZZ5</brm:BILLINFO_ID> 
        <brm:BILL_WHEN>1</brm:BILL_WHEN> 
        <brm:CURRENCY>840</brm:CURRENCY> 
        <brm:CURRENCY_SECONDARY>0</brm:CURRENCY_SECONDARY> 
        <brm:EFFECTIVE_T>2010-02-17T22:37:49Z</brm:EFFECTIVE_T> 
        <brm:PAYINFO_OBJ>0.0.0.1 /payinfo/invoice 226781 0</brm:PAYINFO_OBJ> 
        <brm:PAY_TYPE>10001</brm:PAY_TYPE> 
        <brm:POID>0.0.0.1 /billinfo 226269 0</brm:POID> 
      </brm:BILLINFO>
      <brm:END_T>2010-02-17T22:37:49Z</brm:END_T> 
      <brm:FLAGS>0</brm:FLAGS> 
      <brm:GROUP_INFO /> 
    - <brm:HOST elem="1">
        <brm:HOSTNAME>XXX.XXX.XXX.XXX</brm:HOSTNAME> 
        <brm:TYPE>1</brm:TYPE> 
      </brm:HOST>
    - <brm:HOST elem="2">
        <brm:HOSTNAME>XXX.XXX.XXX.XXX</brm:HOSTNAME> 
        <brm:TYPE>1</brm:TYPE> 
     </brm:HOST>
   - <brm:HOST elem="3">
        <brm:HOSTNAME>XXXXXXXXX.XXX</brm:HOSTNAME> 
        <brm:PORT>0</brm:PORT> 
        <brm:TYPE>2</brm:TYPE> 
     </brm:HOST>
   - <brm:HOST elem="4">
        <brm:HOSTNAME>XXXX.XXX</brm:HOSTNAME> 
        <brm:TYPE>3</brm:TYPE> 
    </brm:HOST>
  - <brm:HOST elem="5">
        <brm:HOSTNAME>XXXX.XXX</brm:HOSTNAME> 
        <brm:TYPE>4</brm:TYPE> 
    </brm:HOST>
    <brm:HTTP_URL>XXXXXXXXXXXXXXX</brm:HTTP_URL> 
  - <brm:LOCALES elem="1">
      <brm:LOCALE>en_US</brm:LOCALE> 
    </brm:LOCALES>
  - <brm:NAMEINFO elem="1">
      <brm:ADDRESS>123 Hollywood Boulevard</brm:ADDRESS> 
      <brm:CANON_COUNTRY>US</brm:CANON_COUNTRY> 
      <brm:CITY>Los Angeles</brm:CITY> 
      <brm:COMPANY /> 
      <brm:CONTACT_TYPE>Account holder</brm:CONTACT_TYPE> 
      <brm:COUNTRY>USA</brm:COUNTRY> 
      <brm:ELEMENT_ID>1</brm:ELEMENT_ID> 
      <brm:EMAIL_ADDR>test_001</brm:EMAIL_ADDR> 
      <brm:FIRST_NAME>Chetn3457</brm:FIRST_NAME> 
      <brm:LAST_NAME>Chet8905</brm:LAST_NAME> 
      <brm:MIDDLE_NAME /> 
      <brm:SALUTATION /> 
      <brm:STATE>NJ</brm:STATE> 
      <brm:TITLE /> 
      <brm:ZIP>90001</brm:ZIP> 
     </brm:NAMEINFO>
   - <brm:PAYINFO elem="0">
    - <brm:INHERITED_INFO>
     - <brm:INV_INFO elem="0">
        <brm:ADDRESS>123 Hollywood Boulevard</brm:ADDRESS> 
        <brm:CITY>Los Angeles</brm:CITY> 
        <brm:COUNTRY>USA</brm:COUNTRY> 
        <brm:DELIVERY_DESCR>test_001</brm:DELIVERY_DESCR> 
        <brm:DELIVERY_PREFER>0</brm:DELIVERY_PREFER> 
        <brm:EMAIL_ADDR /> 
        <brm:INV_TERMS>0</brm:INV_TERMS> 
        <brm:NAME>Chet3457 Chet8905</brm:NAME> 
        <brm:STATE>NJ</brm:STATE> 
        <brm:ZIP>90001</brm:ZIP> 
       </brm:INV_INFO>
      </brm:INHERITED_INFO>
    <brm:INV_TYPE>0</brm:INV_TYPE> 
    <brm:PAY_TYPE>10001</brm:PAY_TYPE> 
    <brm:POID>0.0.0.1 /payinfo/invoice 226781 0</brm:POID> 
    </brm:PAYINFO>
    <brm:POID>0.0.0.1 /plan -1 0</brm:POID> 
    <brm:START_T>2014-05-07T06:00:09Z</brm:START_T> 
    <brm:SUPPORT_PHONE>XXXXXXXXXXXXXXX</brm:SUPPORT_PHONE> 
   </brm:PCM_OP_CUST_COMMIT_CUSTOMER_outputFlist>
  </soapenv:Body>
</soapenv:Envelope>

About Masked Fields in Web Services Responses

SOAP output response XML files may contain masked fields as configured by your BRM implementation. Subscriber fields, including payment information and user credentials, may be hidden in responses for securing sensitive subscriber data.

See "About Securing Sensitive Customer Data with Masking" in BRM Managing Customers for more information on configuring data masking.