Contributions
Invoking java class within SoapUI
Hello Team, I'm trying to execute a custom java class within a Groovy script. Getting...... groovy.lang.MissingMethodException: No signature of method: Script15.EmitLog() is applicable for argument types: () values: [] Possible solutions: wait() error at line: 3 1. Java can be executed at the command line. 2. Created jar file within eclipse 3. Dropped file into C:\Program Files\SmartBear\SoapUI-5.0.0\bin\ext\ 4. Code in java class is import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.Connection; import com.rabbitmq.client.Channel; import java.util.UUID; public class EmitLog { private static final String EXCHANGE_NAME = "logs"; public static void main(String[] argv) throws Exception { ConnectionFactory factory = new ConnectionFactory(); factory.setHost("127.0.0.1"); Connection connection = factory.newConnection(); Channel channel = connection.createChannel(); channel.exchangeDeclare(EXCHANGE_NAME, "fanout"); String message = getMessage(argv); channel.basicPublish(EXCHANGE_NAME, "", null, message.getBytes()); System.out.println(" [x] Sent '" + message + "'"); channel.close(); connection.close(); } private static String getMessage(String[] strings){ if (strings.length < 1) return "This is a test message"; return joinStrings(strings, " "); } private static String joinStrings(String[] strings, String delimiter) { int length = strings.length; if (length == 0) return ""; StringBuilder words = new StringBuilder(strings[0]); for (int i = 1; i < length; i++) { words.append(delimiter).append(strings); } return words.toString(); } } 5. Code in groovy import EmitLog; EmitLog(); Please help.10 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.6KViews0likes1CommentRe: Mock Service Response Logic
I keep getting a script returned [null]. I'm confused as to why. // create XmlHolder for request content def holder = new com.eviware.soapui.support.XmlHolder( mockRequest.requestContent ) // get arguments def arg1 = holder["//*:ACode"] def arg2 = holder["//*:CrType"] def arg3 = holder["//*:FPeriod"] // Select valid response randomly if( arg1 = 'C' & arg2 = '2LM") return "Simple Response"11 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.3KViews0likes0CommentsRe: WSDL Not loading correctly
Okay, I got passed the load wsdl problem. I downloaded SoapUI 5.0 and it resolved that Issue. Now, I'm getting another issue. I installed tomcat 6 on local machine and deployed war to server. I'm getting a 404 error when calling service. However, the wsdl url resolves just fine. I'm confused. please help <html><head><title>Apache Tomcat/6.0.39 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /mockSoupUI/mockCrewComplementResponse</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/mockSoupUI/mockCrewComplementResponse</u></p><p><b>description</b> <u>The requested resource is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.39</h3></body></html>11 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.1KViews0likes0CommentsWSDL Not loading correctly
Hello Team, I have built a mock service and deployed it as WAR onto Tomcat 7. Now when trying to consume Wsdl within another SoapUI project I'm getting the following errors When consuming url. Error loading [http://127.0.0.1:8080/mockResponse?WSDL&interface=CreBinding∂=Common.xsd]: org.apache.xmlbeans.XmlException: org.apache.xmlbeans.XmlException: error: When consuming local wsdl file. Error loading [file:\C:\Users\mtdonovan\Documents\\mockResponse?WSDL&interface=CretBinding∂=Common.xsd]: java.io.FileNotFoundException: C:\Users\mtdonovan\Documents\mocktResponse?WSDL&interface=CreBinding∂=Common.xsd (The filename, directory name, or volume label syntax is incorrect Do I place the schema in the relative folder path in the WAR location? I'm confused. Thank you . These location are in the wsdl <xs:include schemaLocation="/mockResponse?WSDL&interface=CretBinding&part=Common.xsd"/> <xs:include schemaLocation="/mockResponse?WSDL&interface=CreBinding&part=SimpleTypes.xsd"/> <xs:include schemaLocation="/mockResponse?WSDL&interface=CreBinding&part=Feature.xsd"/> <xs:include schemaLocation="/mockResponse?WSDL&interface=CreBinding&part=QueryResults.xsd"/>11 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.8KViews0likes2CommentsRe: Mock Service Response Logic
I have a request with three input parameters. These three values will return my expected response. I have 9 different scenarios that will each return a different response. I have a test step already created that will call the mockservice, but I need to be able to branch on the request coming and provide the associated response. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ust="http://www.test.com"> <soapenv:Header/> <soapenv:Body> <ust:Cre> <ust:A>A</ust:A> <ust:C>X</ust:C> <ust:F>B</ust:F> </ust:Cre> </soapenv:Body> </soapenv:Envelope> Expected Return <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ust="http://www.test.com"> <soapenv:Header/> <soapenv:Body> <ust:CreResponse> <ust:CreList> <!--0 to 100 repetitions:--> <ust:Cre> <ust:CreKey>${guidVal}</ust:CreKey> <ust:CreType>A</ust:CrwType> <ust:CreReqQty>4</ust:CreReqQty> <ust:FDay> <!--Optional:--> <ust:FDayPeriod>Basic</ust:FDayPeriod> <!--Optional:--> <ust:FPeriodCode>B</ust:FPeriodCode> <!--Optional:--> <ust:DLength>1080</ust:DLength> <!--Optional:--> <ust:MaxPeriod>16</ust:MaxPeriod> <!--Optional:--> <ust:MinPeriod>12</ust:MinPeriod> </ust:FDay> <!--1 or more repetitions:--> <ust:DPosition> <ust:ACode>TEST</ust:ACode> <ust:CCode>M</ust:CCode> <ust:Cert>qualified</ust:Cert> <ust:CCode>P</ust:CeCode> <ust:CePosition>P</ust:CPosition> <!--Optional:--> <ust:CreReqQty>1</ust:CreReqQty> </ust:DPosition> </ust:Cre> </ust:CreList> </ust:CreResponse> </soapenv:Body> </soapenv:Envelope>11 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.3KViews0likes0CommentsMock Service Response Logic
Hello Team, I'm just getting into Mocking Up Services and discovered this is such great functionality. However, I need help with placing logic into my Mock Responses. I have built two mock responses. I have also built two requests. I need to build logic in the Mock Service to return the associated response to the correct request. How should I approach this? Do I create a Dispatch Script? If so, do I build a if statement in groovy in order to return back the correct response? Thanks11 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.1KViews0likes5CommentsRe: Test Step Status
Still need help. I can't figure it out. Thank you //Define the object for the collection of requests in the soapUI test case import com.eviware.soapui.model.testsuite.Assertable def soapuiRequests = testRunner.testCase.getTestStepsOfType(com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep ) //Groovy Script to loop through each requests in the test case. soapuiRequests.each { //Creating file name using current date and time def startTime = new Date(); def cur_Time = startTime.getMonth() + "_" + startTime.getDate(); cur_Time = cur_Time + "_" + startTime.getHours() + startTime.getMinutes() +startTime.getSeconds() def fileName = it.name + "_" + cur_Time def testStatus = context.testStep.getAssertionStatus(it).toString() def inputFileRequest = new File("C:/Users/"+ fileName+ "_Request.txt") def inputFileResponse = new File("C:/Users/"+ fileName+"_Response.txt") //Writing soapUI response to the file inputFileResponse.write(context.testCase.getTestStepByName(it.name).getProperty("response").value) //messageExchange.getRequestContent("GetMissions 1.1- MissionKey").toString() //Writing soapUI request to the file inputFileRequest.write(context.testCase.getTestStepByName(it.name).getProperty("rawRequest").value) } log.info ("Completed Write")11 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.4KViews0likes0CommentsRe: Test Step Status
I placed the following code in my code and I'm receiving the following error message def testStatus = context.testStep.getAssertionStatus(it.name).toString() "Can't invoke methods getAssertionStatus() on null object." I'm unsure what going on. Thanks11 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.4KViews0likes0Comments