Service Virtualization

 View Only
  • 1.  trying to use Request Data Copier

    Posted Aug 24, 2020 07:13 PM
    hi ,
    i am trying to assign the attribute id_reference_internal to value id.
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Body>
            <SubmitXMLRequest xmlns="http://rrrrt/" xmlns:ns2="http://www.docrrrrusirrrrgn.net/API/3.0">
    ​​​​​​​            
                <_sRequestXML>
                    <inteflow>
                        
                        <application_details>
                            
                            <id_reference_internal>1-186913284594442</id_reference_internal>

    i have checked the attribute option and inserted value "_sRequestXML_inteflow_application_details_id_reference_external" in first coloumn and "id" in second but it is always blank value


  • 2.  RE: trying to use Request Data Copier

    Posted Aug 25, 2020 01:57 AM

    Hi Nikhil,

     

    Not really sure what your exact requirement is?

     

    Are you trying to copy the value of request argument "_sRequestXML_inteflow_application_details_id_reference_external" Into a DevTest property with the name "id".

    The Request Data Copier copies ALL the arguments and/or attributes and/or metadata (depending on what you check) from your incoming request into properties. It keeps the same name the only thing you can do is add a prefix and/or a suffix to the already existing name. So, how you filled in the RDC you will get a property called "_external_sRequestXML_inteflow_application_details_id_reference_externalid" (and for each other argument a property staring with _external and ending with id.

     

    Are you trying to rename the argument  "_sRequestXML_inteflow_application_details_id_reference_external" To just plain "id" in your incoming request and in your .vsi?

    Then use a Request Data Manager with 2 actions first action you copy argument "_sRequestXML_inteflow_application_details_id_reference_external" to an argument named "id", Second action you delete the original argument "_sRequestXML_inteflow_application_details_id_reference_external".

     

    Hope this helps,

     

    Cheers,

    Danny

     

    ::DISCLAIMER::

    The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.






  • 3.  RE: trying to use Request Data Copier

    Posted Aug 25, 2020 02:20 AM
    Im trying to basically invoke another XML web service call and pass just the below argument and ignore other arguments.
    <id_reference_internal>1-186913284594442</id_reference_internal>
    The value of this argument is present in request .

    I thought of just copying that argument value into a new argument and use it in the invoke XML request body


  • 4.  RE: trying to use Request Data Copier

    Posted Aug 25, 2020 02:37 AM

    Ok, I suggest you define your Request Data Copier by selecting arguments and then adding "request_" as prefix. The reason to use "request_" is that all properties with names starting like this get cleaned up after the Respond step (this avoids that a next iteration of the .vsm where this argument is missing in the request for whatever reason would use the value of the previous iteration).

     

    Now you can use the expression {{request_<yourArgumentName>}} wherever you want that value.

     

    Hope this helps.

     

    Cheers,

    Danny

     

    ::DISCLAIMER::

    The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.






  • 5.  RE: trying to use Request Data Copier

    Posted Aug 25, 2020 05:43 AM
    hi danny,

    for some reason im still not able to access the attributes.
    i have  generate the model with the help of recorder:i need to get the highlighted attribute
    in my request data copier i have added "request_<attributename>"
    to access the attribute should i use {{request_Body_SubmitXMLRequest__sRequestXML_inteflow_application_details_id_reference_external}}
    or
    based on my actual request body:
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Body>
            <SubmitXMLRequest xmlns="http://rrrrt/" xmlns:ns2="http://www.docrrrrusirrrrgn.net/API/3.0">
    ​​​​​​​            
                <_sRequestXML>
                    <inteflow>
                        
                        <application_details>
                            
                            <id_reference_external>1-186913284594442</id_reference_external>
    i should use :-  {{request_request__sRequestXML_inteflow_application_details_id_reference_external}}???



  • 6.  RE: trying to use Request Data Copier

    Posted Aug 25, 2020 07:29 AM

    Hi,

     

    In RDC when you add "request_" (not "request_<attributename>"???) then you can use {{request_Body_SubmitXMLRequest__sRequestXML_inteflow_application_details_id_reference_external}} where you need that value.

     

    However inside the .vsm you can NOT use the value after the Respond step because the latter will remove all properties starting with "request_". If you call to a 3rd WebService is after the Respond step then use another prefix like "req_"

     

    As a sidenote it looks like your recording and/or .vsm does not have the SOAP protocol enabled? Only the XML data protocol? Not using SOAP makes your operation name generic and makes your argument names longer. I guess all your operation names will be called "Envelope"? Using SOAP DPH your operation name will be SubmitXMLRequest and your argument names _sRequestXML_inteflow_application_details_id_reference_external, ...

    Cheers,

    Danny

    ::DISCLAIMER::

    The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.






  • 7.  RE: trying to use Request Data Copier

    Posted Aug 25, 2020 05:40 AM
    Hi Nikhil,

    Another option is to extract the value of required tag in a property and then use it later wherever needed in the service.

    Thanks

    ------------------------------
    Regards,
    Vaibhav Jain
    Capgemini
    ------------------------------



  • 8.  RE: trying to use Request Data Copier

    Posted Aug 25, 2020 05:47 AM
    Edited by Nikhil Singh Aug 25, 2020 06:04 AM
    hi vaibhav,

    can you please help with the step on how it is done?
    and also the attribute name that i see generated from recoder is: Body_SubmitXMLRequest__sRequestXML_inteflow_application_details_id_reference_external
    based on the request i send it will be :_sRequestXML_inteflow_application_details_id_reference_external
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Body>
            <SubmitXMLRequest xmlns="http://rrrrt/" xmlns:ns2="http://www.docrrrrusirrrrgn.net/API/3.0">
    ​​​​​​​            
                <_sRequestXML>
                    <inteflow>
                        
                        <application_details>
                            
                            <id_reference_external>1-186913284594442</id_reference_external>



  • 9.  RE: trying to use Request Data Copier

    Posted Aug 25, 2020 06:47 AM
    Hi Nikhil, 

    Directly using {{request_argumenttag}} will retrieve value in vsi only by default.

    If you want to use Request Data Copier, follow the below steps:

    Assume your request is as below: [and you want to retrieve value of one of the tags]

    Add Request Data Copier protocol:

    In vsm, it will be as below:

    Now you can use the values of attribute by using below format anywhere:

      <test>{{req_Body_doGoogleSearch_oe}}</test>

    Hope this helps.

    Thanks


    ------------------------------
    Regards,
    Vaibhav Jain
    Capgemini
    ------------------------------



  • 10.  RE: trying to use Request Data Copier

    Posted Aug 25, 2020 07:58 AM
    Thanks Vaibhav and Danny this solved the confusion I had