How to upload a file via SOAP, as an attachment using python zeep
Hi folks, I am trying to attach a log.txt file with my createAttachment web service. I am using zeep as a client to do so but unable to do. I tried the same using MIME but unable to do so. import requests url = "WSDL url" payload = '''<?xml version="1.0" encoding="utf-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://www.ca.com/UnicenterServicePlus/ServiceDesk"> <soapenv:Header/> <soapenv:Body> <ser:createAttachment> <sid>'''+sid+'''</sid> <repositoryHandle>doc:12</repositoryHandle> <objectHandle>cr:1306599</objectHandle> <description>Testing to attach document to change order</description> <fileName>log</fileName> </ser:createAttachment> </soapenv:Body> </soapenv:Envelope>''' files=[ ('fileName',('Testing.txt',open('C:/Users/prasaka/Desktop/Testing.txt','rb'),'text/xml')) ] headers = { 'Content-Type': 'text/xml; charset=utf-8', 'soapAction': 'application/soap+xml' } response = requests.request("POST", url, headers=headers, data={'data' : payload}, files=files) print(response.text) print(response.status_code)2.3KViews0likes3CommentsHow do I set the status of a Script Assertion?
After looking at this documentation, GroovyScriptAssertion (SoapUI 3.0.0 API) (smartbear.com), I've tried the following def currentStep = context.getCurrentStep(); def assertion = currentStep.getAssertionByName('Script Assertion'); assertion.setStatus(com.eviware.soapui.model.testsuite.Assertable.AssertionStatus.FAILED); but I get the error setStatus() exception: groovy.lang.MissingMethodException: No signature of method: com.eviware.soapui.impl.wsdl.teststeps.assertions.basic.GroovyScriptAssertion.setStatus() is applicable for argument types: (com.eviware.soapui.model.testsuite.Assertable$AssertionStatus) values: [FAILED] If I output assertion.getClass() It tells me that assertion's class is com.eviware.soapui.impl.wsdl.teststeps.assertions.basic.GroovyScriptAssertion@71d72a30 What am I doing wrong? I'm using 5.7.1 Edit: If it's not possible to set the status of a test assertion or test step, is it possible to set the status of a testCase?176Views0likes1CommentDynamic Operation name in Mocking
Hi Team, By default the operation name for mocked response is picked from UI as shown below: I am trying to generate dynamic response based on the operation name at runtime but not able to get the correct Groovy code for that. I tried checking this 'log.info mockOperation.name' but it returns the overall mock operation and not the one displayed in UI Can you please let me know the corresponding Groovy script to achieve this?Solved202Views0likes1CommentMass Install via Intune Soap UI latest Version
Hello Team, Hello team, as a company we would like to use your product and distribute it via Intune. Do you have any documentation on how we can deploy your software to all our clients via Intune? Which version do you recommend? Which installation command do you recommend? Which uninstall command do you recommend? Which detection rules should be set. I look forward to hearing from you as soon as possible. Many thanks and best regards Michael189Views0likes0CommentsPlease help with SSL Handshake exception
Hello, I am trying to trigger a test case in soapUI 5.2.1 from command Linux , with https url and getting handshake exception. Please help if anyone aware of how to fix. Same test works from UI but failing in linux command line. 03:52:12,810 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: CONNECT env.test.gcp.com:443 HTTP/1.1 03:52:12,839 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 200 Connected 03:52:12,840 DEBUG [HttpClientSupport$SoapUIHttpClient] Tunnel to target created. 03:52:13,115 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request 03:52:13,115 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: POST /env/bcmai/restservices/gcw/v1/mycontract/clientcontracts/ HTTP/1.1 03:52:22,839 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] I/O error closing connection javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake ============================================================= I have below options in SoapUI-5.2.1.vmoptions -Dsoapui.https.protocols=SSLv3,TLSv1.2 -Dsoapui.https.ciphers=TLS_RSA_WITH_AES_256_CBC_SHA256 -Dsun.security.ssl.allowUnsafeRenegotiation=true -Djavax.net.debug=ssl:verbose From groovy too tried enabling proxy below before running api, which didnt help. import com.eviware.soapui.impl.wsdl.support.http.ProxyUtils ProxyUtils.setProxyEnabled(true)247Views0likes0CommentsParse date from string without format
I need to parse string into a date. I know the string is a date. I don't care about the formatting. I've tried Date.parse(myDateString) But it seems to want the format of the date. Is there any way I can parse the date without the code being aware of the format?218Views0likes0CommentsSoapUI Groovy Script doesn't reflect correct TestStep execution Status
Hi All, I have a TestStep for sending message to MQ queue using JMS endpoints. A "JMS Status" assertion validates the response status. I am trying to execute the TestSteps in continuous loop until 5 times, but the results are strange. Scenario-1: If the queues are initially enabled & thereafter disabled the TestStep status changes from OK to FAILED which is expected. Scenario-2: However, if the queues are initially disabled & thereafter enabled the TestStep status doesn't change from FAILED. Note: All during the TestStep execution, messages are going into MQ queue once they are enabled or withheld if disabled. Therefore can someone explain where I am going wrong with the script or the configurations. Below is a snippet of the Groovy Script that I am using. Integer counter = 1; Integer delay = 5; while (counter < 6) { myTestStepResult = testRunner.runTestStepByName("MQ put_message") myStatus = myTestStepResult.getStatus() log.info " message no: " + counter + " - " + myStatus.toString() counter++ Thread.sleep(delay * 1000) }240Views0likes0CommentsCall external javascript function from Groovy in SoapUI
Hi, We have a requirement where we have to call an external javascript function within groovy script in SoapUI, This was possible from Java using : ScriptEngine engine = new ScriptEngineManager().getEngineByName("javascript") engine.eval(new FileReader(JAVA_SCRIPT_FILE_PATH)) Invocable invocable = (Invocable) engine String result = invocable.invokeFunction(JAVA_SCRIPT_MAIN_METHOD, <Method Parameter List>) However, same java code is not working in groovy and definitely itseems like something is missing here, Reaching out for any sort of help this community can provide here Thanks in advance861Views0likes6Comments