Service Virtualization

  • 1.  Filter to use

    Posted May 31, 2018 02:54 AM

    I have a request which has one telephone no with UK code 44(10 digit #), which should come in response XML as 0(10 digit #). What filter can i use here. or how can i capture the value from request and convert it to display accordingly in my response.



  • 2.  Re: Filter to use

    Broadcom Employee
    Posted May 31, 2018 08:40 AM

    I do know know what version of DevTest you are on but refer to this Documentation link:

     

    Create Property Based on Surrounding Values - DevTest Solutions - 10.3 - CA Technologies Documentation 

     

    You want to transform, not capture.

     

    You could use “Create property Based on Surrounding Values” using the 44 as an anchor, then add the 0 by concatenating it with the property.

     

    Hope this helps.



  • 3.  Re: Filter to use

    Broadcom Employee
    Posted May 31, 2018 10:06 AM

    As Marcy said you can use Create Property Based on Surrounding Values filter to capture what you are looking or if you share your sample response then we can recommend you if any other filter can be used.



  • 4.  Re: Filter to use

    Posted Jun 01, 2018 03:28 AM

    Hi Both, am using Devtest 10.0.0 version and below are my request and response files.

     

    Request:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
    <tns:commitMsisdn xsi:schemaLocation="http://www.ee.co.uk/excalibur_es/crm/excalibur/service/ArmResource/ArmResourceRequest/v1.0 CommitMsisdnRequest.xsd " xmlns:ns1="http://www.ee.co.uk/common/datatype/DataTypes/v1.0" xmlns:ns11="http://www.ee.co.uk/common/message/Request/v1.0" xmlns:tns="http://www.ee.co.uk/excalibur_es/crm/excalibur/service/ArmResource/ArmResourceRequest/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <message>
    <systemName>BTUKB</systemName>
    <keyIdentifier>
    <msisdn>447812345609</msisdn>
    </keyIdentifier>
    </message>
    </tns:commitMsisdn>
    </soapenv:Body>
    </soapenv:Envelope>

     

     

    response:

    <soapenv:Envelope xmlns:soapenv = "http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
    <tns:commitMsisdnResponse
    xsi:schemaLocation = "http://www.ee.co.uk/excalibur_es/crm/excalibur/service/ArmResource/ArmResourceResponse/v1.0 CommitMsisdnResponse.xsd "
    xmlns:ns1 = "http://www.ee.co.uk/common/datatype/DataTypes/v1.0"
    xmlns:ns11 = "http://www.ee.co.uk/common/message/ResponseMessage/v1.0"
    xmlns:ns12 = "http://www.ee.co.uk/common/message/Notifications/v1.0"
    xmlns:ns13 = "http://www.ee.co.uk/common/message/Response/v1.0"
    xmlns:tns = "http://www.ee.co.uk/excalibur_es/crm/excalibur/service/ArmResource/ArmResourceResponse/v1.0"
    xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance">
    <message>
    <responseStatus>0</responseStatus>
    <ctn>07997300156</ctn>
    </message>
    </tns:commitMsisdnResponse>
    </soapenv:Body>
    </soapenv:Envelope>



  • 5.  Re: Filter to use
    Best Answer

    Broadcom Employee
    Posted Jun 01, 2018 06:56 AM

    Is this a test or a SV requirement?

     

    I've had to do this a few times for SV, as it seems to be a common thing in UK telcos to convert from msisdn to ctn

     

    Firstly, look at your High Level Design (HLD) document, to determine whether the business requirement is that the msisdn is always going to be 12 digits beginning with the UK country-code.

     

    Then, look in the HLD (or Low Level Design document) to determine whether msisdn is ever used in a response.

     

    The answer to those questions determines how you deal with the conversion.

     

    If it always begins with "44", and if msisdn is never used in the response, I would add a scriptable request-side DPH, doing something like this (not syntax-checked):

     

    import com.itko.util.ParameterList;

    import com.itko.util.Parameter;

    ParameterList args = lisa_vse_request.getArguments();

    msisdn = args.getParameterValue("msisdn");

    ctn = msisdn.replace("44", "0");

    args.removeParameter("msisdn");

    args.addParameter(new Parameter("ctn", ctn));

    lisa_vse_request.setArguments(args);

     

    If the rules for msisdn are different, you will want to use a different string replacement routine, perhaps something like:

    ctn = "0" + msisdn.substring(2, msisdn.length());

     

    Regenerate your virtual service with that scriptable DPH, and your request arguments will now include "ctn" instead of "msisdn", and your response will include <ctn>{{=request_ctn;/*07997300156*/}}</ctn> instead of the raw value.



  • 6.  Re: Filter to use

    Posted Jun 08, 2018 05:27 AM

    HI Rick..Thanks for your suggestion. I tried "Create-property-based-on-surrounding-values" filter, am able to replace 44 with Zero.