Contributions
Re: SSLException: Unrecognized SSL message, plaintext connection
I did some extra testing and discovered something: I have two free SoapUI installations (5.1.3 and 5.4.0) and one Pro version. The description above is based on the free versions. When I use the Pro version everything seems to work. I can start the mock in SSL mode and send a message using https. When I use the same settings in the free versions I get the following error when starting the mock: 2018-03-20 09:46:01,020 ERROR [errorlog] java.net.BindException: Address already in use: bind java.net.BindException: Address already in use: bind at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Unknown Source) at sun.nio.ch.Net.bind(Unknown Source) at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source) at org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:216) at org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:315) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.Server.doStart(Server.java:235) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at com.eviware.soapui.monitor.JettyMockEngine.startMockService(JettyMockEngine.java:147) at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.start(WsdlMockRunner.java:201) at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.<init>(WsdlMockRunner.java:71) at com.eviware.soapui.impl.support.AbstractMockService.start(AbstractMockService.java:249) at com.eviware.soapui.impl.support.AbstractMockService.start(AbstractMockService.java:222) at com.eviware.soapui.impl.support.AbstractMockService.start(AbstractMockService.java:58) at com.eviware.soapui.tools.SoapUIMockServiceRunner.runMockService(SoapUIMockServiceRunner.java:197) at com.eviware.soapui.tools.SoapUIMockServiceRunner.runRunner(SoapUIMockServiceRunner.java:117) at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:188) at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:123) at com.eviware.soapui.tools.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:98) at com.eviware.soapui.tools.SoapUIMockServiceRunner.main(SoapUIMockServiceRunner.java:66) When I change the port to a number I haven't used I can start the mock but end up with the described behaviour. When I restart free SoapUI and start the mock again I get the same error. Maybe something is blocked? I closed SoapUI and used netstat -a -b. Port 8444 doesn't show up in the list. After starting SoapUI I ran it again and port 8444 doesn't show up. When I try to start the mock and get the error, netstat shows port 8444 only once2KViews0likes0Comments- 2KViews0likes0Comments
Re: Run script assertion without sending
Hi Rao, I spoke to the team and they provided another xsd. The validation is working now. There is one last question I have: When I run the script it passes even when the validation fails. What can I do to make it fail if the validation is not OK? Regards, Jurriaan7 years agoPlace ReadyAPI QuestionsReadyAPI Questions4.4KViews0likes2CommentsSSLException: Unrecognized SSL message, plaintext connection
Hi, I want to setup SSL for a mockservice so I followed the different steps inSecuring mockservices. I created a keystore usingjdk1.7.0_21. I entered passwords and as CN I used localhost since I send the message to a localhost. Next I filled in the SSL preferences: When I run the mockservice and send a request (https and specified mock port) I get an error in the lower left corner: Error getting response;javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection. How can I make this work? What am I missing... Thanks in advance2KViews0likes2Comments- 7 years agoPlace ReadyAPI QuestionsReadyAPI Questions4.5KViews0likes6Comments
Re: Run script assertion without sending
Hi, Thanks for sharing the script. I replaced the 'println' with 'log.info' so I can see what's going on. The script is now: /** * this groovy script validates given xml file * with the given xsd file **/ import org.xml.sax.SAXException import javax.xml.transform.stream.StreamSource import java.nio.charset.StandardCharsets import javax.xml.XMLConstants import javax.xml.validation.SchemaFactory //Provide valid xml instance & and xsd file paths below def xml = 'C://Temp//BGTConnector//test2.xml' def xsd = 'C://SoapUI projecten//BGT Connector//imgeo0300//verticaal//imgeo0300_msg_verticaal.xsd' //Not required to edit beyond this point def isFileExists(String fileName) { def file = new File(fileName) def result = file.exists() if (result) { log.info "$fileName exists" } else { log.info "$fileName does not exist" } result } def isValid(String xsd, String xml) { def result = false if (isFileExists(xsd) && isFileExists(xml)) { def factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI) try { def schema = factory.newSchema(new File(xsd)) def validator = schema.newValidator() validator.validate(new StreamSource(new InputStreamReader(new FileInputStream(xml), StandardCharsets.UTF_8))) log.info "$xml is valid." result = true } catch (SAXException ex) { log.info "$xml is not valid because \n" log.info ex.localizedMessage } catch (FileNotFoundException ex) { log.info ex.localizedMessage } catch (IOException ex) { log.info ex.localizedMessage } finally { return result } } else { log.info "Can't validate file as one of the file is not found" } result } //Validate xml by calling above method isValid(xsd, xml) When I run the groovy script it finds the xsd and xml but fails because it cannot resolve a name. I searched for it and it's found in another xsd. I suspect the selected xsd has references to other xsd's which aren't loaded. Is it possible to load multiple xsd's? Can I refer to a property (which contains the message) instead of the xml file? Thanks for helping out, Jurriaan7 years agoPlace ReadyAPI QuestionsReadyAPI Questions4.5KViews0likes7CommentsRe: Run script assertion without sending
Hi Bill, Thanks for your suggestion. Once the request is sent and I add extra assertions, they are automatically executed. In my situation that's not the case. The request is a teststep in a testcase and the response is empty. When I leave the URL bar empty and execute the testI receive a message an url must be entered. The script assertion consists of: def project = messageExchange.modelItem.testStep.testCase.testSuite.project def wsdlcontext = project.getInterfaceAt(1).getDefinitionContext() def validator = new com.eviware.soapui.impl.wsdl.support.wsdl.WsdlValidator(wsdlcontext); def errors = validator.assertRequest(messageExchange, false) assert errors.length < 1 The message itself is first stored in a property and than transfered to the request via the property transfer step. The property is filled with the followingsetup script: def myRequest=new File("c:\\temp\\bgtconnector\\test2.xml").getText() testRunner.testCase.setPropertyValue( "Request", myRequest ) def xmltop = '''<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:stuf="http://www.geostandaarden.nl/imgeo/2.1/stuf-imgeo" xmlns:stuf1="http://www.egem.nl/StUF/StUF0301" xmlns:xlin="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml" xmlns:ns="http://www.opengis.net/citygml/2.0"> <soapenv:Header/> <soapenv:Body>''' def xmlbottom = ''' </soapenv:Body> </soapenv:Envelope>''' testRunner.testCase.setPropertyValue( "Bericht", xmltop+myRequest+xmlbottom ) By transferring the message in the property to an actual message I thought it would be easier to validate (xsd validation) the message. Maybe it's easier (if possible?) to directly validate the content of the property?7 years agoPlace ReadyAPI QuestionsReadyAPI Questions4.5KViews0likes0CommentsRun script assertion without sending
Hi All, I copied an xml message into a request (part of a testcaseusing property transfer). Next I created a script assertion which will validate the content of the request. Is it possible to run the script assertion without sending the request? I only want to know if the message validates against the xsd... Thanks in advance, JurriaanSolved7 years agoPlace ReadyAPI QuestionsReadyAPI Questions4.8KViews0likes11Comments