ContributionsMost RecentMost LikesSolutionsRe: Problems with refresh OAuth2 token This is a slightly updated version of the script that can be putinto the Automation for the auth profile and will only renew when expired: // Import the required classes import com.eviware.soapui.impl.rest.actions.oauth.OltuOAuth2ClientFacade; import com.eviware.soapui.support.editor.inspectors.auth.TokenType; import com.eviware.soapui.model.support.ModelSupport; // Set up variables def project = ModelSupport.getModelItemProject(context.getModelItem()); def stepProfile = context.getCurrentStep().getHttpRequest().getSelectedAuthProfile() def authProfile = project.getAuthRepository().getEntry(stepProfile); def oldToken = authProfile.getAccessToken(); def tokenType = TokenType.ACCESS; // Create a facade object def oAuthFacade = new OltuOAuth2ClientFacade(tokenType); // Request an access token in headless mode oAuthFacade.requestAccessToken(authProfile, true, true); // Wait until the access token gets updated for(int i = 0; i<=3000; i++){ if(oldToken != authProfile.getAccessToken()){ break } sleep(1) } I would suggest this is a work-around for a ReadyAPI bug as we should be able to set this type of token to renew automatically. Regards, -- Stephen Re: Can't reach serviceV from external clients. When did you update the EULA, as this is not the EULA that I agreed to when I licenced your software? Re: Can't reach serviceV from external clients. Can you please indicate which part of the licence agreement my post might have broken? Re: Can't reach serviceV from external clients.Can't reach serviceV from external clients. I have created a REST virt in the ServiceV tab of ReadyAPI so that I can control all aspects of the system under test. When I try to access the virt from the system under test, I get the following error: "Can't reach serviceV from external clients." Is this a new restriction with ReadyAPI or am I missing something? I've done this for SOAP requests using SoapUI Pro in the past without issue. Thanks, -- Steve HTTP Test Request - Attachment is sent twiceHello, I'm trying to POST a file to a URL using HTTP Test Request. I found the following instructions in the forum: 1) Create an HTTP Request Step 2) Set the method to POST 3) Set the "Media Type" of the content to multipart/form-data 4) Check the "Post QueryString" checkbox 5) Attach the file(s) you want to send in the Attachments tab at the bottom of the request window 6) Add the desired parameters and their values; those parameters that should contain the contents of an attachment ("fname" in your example) should have the value "file:<name of attachment>", for example "file:readme.txt" if you attached a file named readme.txt My test step looks like this: However, instead of the attachment being sent once with the requested parameters, it is sent twice: ------=_Part_2_171977183.1332778175776 Content-Type: text/xml Content-Transfer-Encoding: binary Content-Disposition: form-data; name="file"; filename="steve-batch.xml" <?xml version="1.0" encoding="utf-8"?> ..... ------=_Part_2_171977183.1332778175776 Content-Type: application/xml; name=steve-batch.xml Content-Transfer-Encoding: binary Content-Disposition: form-data; name="steve-batch.xml"; filename="steve-batch.xml" <?xml version="1.0" encoding="utf-8"?> ..... This is what I get if I use curl: curl --form file=@steve-batch.xml "http://10.191....../" Content-Type: application/xml Content-Disposition: form-data; name="file"; filename="steve-batch.xml" ...<?xml version="1.0" encoding="utf-8"?> ..... curl works, and is what I'm looking for. What am I doing wrong with my test step? Thanks, -- Steve