Service Virtualization

Expand all | Collapse all

Is there any way that DevTest can ignore the case of the tags while trying to find a matching request

  • 1.  Is there any way that DevTest can ignore the case of the tags while trying to find a matching request

    Posted Jul 20, 2018 12:05 PM

    I have a MAR file deployed with 15-20 transactions . With the new code drop there has been a change in the cases of the tags. 

    For eg

    I have a scenario where in i have created a transaction for the following request

    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
    </soapenv:Header>
    <soapenv:Body>
    <InquireUnifiedCustomerServiceProfileRequest xmlns="http://csi.cingular.com/CSI/Namespaces/Container/Public/InquireUnifiedCustomerServiceProfileRequest.xsd">
    <CustomerCriteria>
    <subscriberNumber>4693239002</subscriberNumber>
    </CustomerCriteria>
    <AvailableIntegratedOffers>
    <availableIntegratedOffersIndicator>true</availableIntegratedOffersIndicator>
    <applicationId>Clarify</applicationId>
    </AvailableIntegratedOffers>
    </InquireUnifiedCustomerServiceProfileRequest>
    </soapenv:Body>
    </soapenv:Envelope>

     

    Now with  the new code drop there has been changes in the case of fields and i want DevTest to ignore the case when its trying to find a match.

     

    For eg now the above request may come in as 

    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
    </soapenv:Header>
    <soapenv:Body>
    <InquireUnifiedCustomerServiceProfileRequest xmlns="http://csi.cingular.com/CSI/Namespaces/Container/Public/InquireUnifiedCustomerServiceProfileRequest.xsd">
    <CustomerCriteria>
    <SubscriberNumber>4693239002</SubscriberNumber>
    </CustomerCriteria>
    <AvailableIntegratedOffers>
    <availableIntegratedOffersIndicator>true</availableIntegratedOffersIndicator>
    <applicationId>Clarify</applicationId>
    </AvailableIntegratedOffers>
    </InquireUnifiedCustomerServiceProfileRequest>
    </soapenv:Body>
    </soapenv:Envelope>

     

    OR 

     

    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
    </soapenv:Header>
    <soapenv:Body>
    <InquireUnifiedCustomerServiceProfileRequest xmlns="http://csi.cingular.com/CSI/Namespaces/Container/Public/InquireUnifiedCustomerServiceProfileRequest.xsd">
    <CustomerCriteria>
    <SUBSCRIBERNumber>4693239002</SUBSCRIBERNumber>
    </CustomerCriteria>
    <AvailableIntegratedOffers>
    <availableIntegratedOffersIndicator>true</availableIntegratedOffersIndicator>
    <applicationId>Clarify</applicationId>
    </AvailableIntegratedOffers>
    </InquireUnifiedCustomerServiceProfileRequest>
    </soapenv:Body>
    </soapenv:Envelope>

     

    How can i achieve this in DevTest...I want to reuse the same MAR file without a lot of rework. Can this be done?

     

    Thank you in advance for your help.



  • 2.  Re: Is there any way that DevTest can ignore the case of the tags while trying to find a matching request
    Best Answer

    Broadcom Employee
    Posted Jul 25, 2018 09:53 AM

    You can write Match Script in VSI to ignore the request data arguments which are not needed for comparison or just look for the arguments which are needed and can match the transaction. Please see the Match Script documentation at Transactions Tab for Stateless Transactions - DevTest Solutions - 10.3 - CA Technologies Documentation.

     

    or rerecord the VS and use the Request Data Manager DPH to keep only mandatory arguments and create VS. This way if your request changes then matching will happen on few elements only.  Request Data Manager Data Protocol - DevTest Solutions - 10.3 - CA Technologies Documentation



  • 3.  Re: Is there any way that DevTest can ignore the case of the tags while trying to find a matching request

    Broadcom Employee
    Posted Jul 25, 2018 10:04 AM

    For ignoring the case of the tags, you can write something like below in the Scriptable DPH on request side and see if that helps.

     

    Converting arguments to lower case:
    import com.itko.util.ParameterList;
    import com.itko.util.Parameter;

    ParameterList args = lisa_vse_request.getArguments();
    ParameterList newArgs = new ParameterList();

    for (int i = 0; i < args.size(); i++) {
    Parameter param = args.get(i);
    param.setKey(param.getKey().toLowerCase());
    newArgs.addParameter(param);
    }

    lisa_vse_request.setArguments(newArgs);