How can I paste a value from the clipboard into a SOAP proje

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Trevor Hughes
Junior Coder
Posts: 25
Joined: Sun Dec 15, 2013 9:27 pm

How can I paste a value from the clipboard into a SOAP proje

Post by Trevor Hughes » Wed Aug 12, 2015 10:24 pm

This question relates to the previous topic:
"How to locate a string within XML tags "

Firstly thank you very much for the help provided with the previous topic mentioned above.

The previous topic provided a solution to extracting a string from within an XML tag and placing this on the clipboard.

I now need to take that value on the clipboard and place it between an XML tag "<Authentication>", within another SOAP project (see attached screenshot). I was provided a way of taking this value and inserting it between the tags, however my understanding of this sadly lacking. The value pastes in between the tags in my Macro Scheduler script, however what I want to do is to paste the value into the SOAP project as seen in the screenshot.

So in summary the plan is to:
1. Find the string within the <Authentication> tag
2. Select the string
3. Replace the string with the value on the clipboard.

If I can do this then I am hoping that I can use a similar method to find strings within other tags (e. <UniformResourceIdentifier> and replace it with a variable.

I appreciate the help that has already been provided greatly and hope that a solution can be suggested to the above.

Kind regards
Trevor

hagchr
Automation Wizard
Posts: 331
Joined: Mon Jul 05, 2010 7:53 am
Location: Stockholm, Sweden

Re: How can I paste a value from the clipboard into a SOAP p

Post by hagchr » Thu Aug 13, 2015 8:52 am

Hi, just for completeness, my previous suggestion on how one can replace the string within the Authentication Tag.

This code generates the overall string. If it is possible on your side to copy the string (from the message box) and paste it into the WS_SubmitLodgeNoAttach window replacing the current content then it would be easy to modify the code below to make it work, ie copy/read the original string, replace the sub-string, and then paste the new string back. (Sorry again, on travel the whole week so just a few minutes here and there to comment).

Any other suggestions?

Code: Select all

GetClipBoard>tmpClip,0

LabelToVar>tmpString,String0,1,0,{"*/"}

Let>tmp0=(?<=<Authentication>).+?(?=</Authentication>)
RegEx>tmp0,String0,0,m,nm,1,tmpClip,String1

MDL>String1

/*
tmpString:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://somewebsite.govt.nz/jbms/msggate/dochdr/v2">
   <soapenv:Header/>
   <soapenv:Body wsu:Id="id-5" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
      <v2:DocumentManifest>
         <NumberOfItems>1</NumberOfItems>
         <ManifestItem>
            <Type>DEC</Type>
            <MimeTypeQualifierCode>text/xml</MimeTypeQualifierCode>
            <UniformResourceIdentifier>HERA.xml</UniformResourceIdentifier>
           <Authentication>xHHAEF25c3V0Pc65TakchJ3nkkdmJ/7ubXKIGl+jrjM=</Authentication>
         </ManifestItem>
      </v2:DocumentManifest>
   </soapenv:Body>
</soapenv:Envelope>
*/

Trevor Hughes
Junior Coder
Posts: 25
Joined: Sun Dec 15, 2013 9:27 pm

Re: How can I paste a value from the clipboard into a SOAP p

Post by Trevor Hughes » Fri Aug 14, 2015 2:19 am

Hello

Thank you for the advice. Your suggestion is perfect. I will give it a go.

Thank you very much for the help.

Kind regards
Trevor

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts