Contributions
Re: Groovy operations trim() and replace() seems to doesn't work in Soapui
for example: <node> test1 <subnode> test2 </subnode> test3 </node> what I want is: <node>test1<subnode>test2</subnode>test3</node> Thanks in advance, Shamane20007 years agoPlace ReadyAPI QuestionsReadyAPI Questions42KViews0likes1CommentRe: Groovy operations trim() and replace() seems to doesn't work in Soapui
@ashutoshanshu wrote: ...and by the way, what is your input String and what is your expected output? I have a lot of properties, containing xml parts (with linebreaks) and I want to linearize them for using in a *.csv file.And save csv with aditionally linebreaks are ... :smileymad: And because all of my tries with xpath and xqerry were unsucsessfully, I trieed it now with a grovy script.7 years agoPlace ReadyAPI QuestionsReadyAPI Questions42KViews0likes3CommentsRe: Groovy operations trim() and replace() seems to doesn't work in Soapui
Hi ashutoshanshu, thanks a lot, your syntax works. I realy don't know why I haven't found this solution, maybe it was to late for me yesterday... ;-) Do you have also a clue, how to do this in a xpath or xqerry? If I try this like this: replace(/*,"\\s+","") then my XML structure is away. (in a Property Transfer Step) input: <node>test1<subnode>test2</subnode>test3</node> output: test1 test2 test3 best regards, Shamane20007 years agoPlace ReadyAPI QuestionsReadyAPI Questions42KViews0likes5CommentsGroovy operations trim() and replace() seems to doesn't work in Soapui
I tried to get rid of whitespaces and newlines with groovy. But if I try this in Groovy, the resul is either a not trimed string, or an error (in the case of "replace()" ) String response = " <blub>\r\nBlaaaah asd\r\n<Blä /> asd asdsad \r\n asdasd asdasd</blub>" log.info("before trim: " + response) log.info("After replace1: " + response.trim() ) Output is: After replace1: <blub> Blaaaah asd <Blä /> asd asdsad asdasd asdasd</blub> */ and with "replace" it also not work: log.info("After replace2: " + response.replace("[\n\r]*", "" ) and there just came a Error message: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script81.groovy: 11: unexpected token: @ line 11, column 63. sponse.replace("[\n\r]*", "" ) ^ org.codehaus.groovy.syntax.SyntaxException: unexpected token: @ line 11, column 63. at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:143) at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:111) at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:237) at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:167) at org.codehaus.groovy.control. .... */ Whats wrong here? PS: I am using ReadyAPI 2.0.2 PPS: yes, I have also tried to do it with xpath "normalize-space()", but there I have another problem - the XML-Structure is lost... maybe I have to post another question about that...Solved7 years agoPlace ReadyAPI QuestionsReadyAPI Questions44KViews0likes7CommentsRe: Inconsistent behavior with property expansion in xQuery assertions
I am also interested in the Question 2) Why aren't Exeptions in Assertions handled? Or ist there a workaround like "Try/Catch" ? (If so, i haven't found the rigth Syntax there. ) Thanks in advance for help...7 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.6KViews0likes0CommentsRe: [Res] DB Connection string is not updated when changing env
Hi, is there any good news regarding this issue? In this post (http://forum.loadui.org/viewtopic.php?f=2&t=23945&hilit=1210&sid=290acd8c9e676966fbdd1d9569c9c383 ) I have read something about this issue too (SOAP-1210). PS: Where can i see the state of this ticket numbers? Is there a public access to JIRA or something? With best regards, Shamane10 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.3KViews0likes0CommentsRe: Error: Could not load keystore/truststore
I have the same problem here up to version 5.0 (Nigthly). The Certificate and Password can be load and used for requests via "Preferences/SSL Settings". But if I take the same settings in the WS-Security settings, to use it with different environments, the error described from parwezwahid appears. Some more Message from the console: 15:47:32,071 ERROR [SoapUI] An error occurred [failed to extract any certificates or private keys - maybe bad password?], see error log for details 15:47:37,078 WARN [KeyMaterialWssCrypto] Using fallback method to load keystore/truststore due to: Invalid keystore format Please report bug! PKCS12 detection failed to realize this was PKCS12! ------ ASN.1 PKCS Structure ------ oid1: HIDE salt: HIDE ic: HIDE bigPayload-length: HIDE All oids: HIDE and after press enter in the Password field of "WS-Security/Keystores" following message appear. 16:01:46,323 ERROR [SoapUI] An error occurred [failed to extract any certificates or private keys -maybe bad password?], see error log for details java.lang.NullPointerException at java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:155) at java.util.ResourceBundle.getObject(ResourceBundle.java:387) at java.util.ResourceBundle.getString(ResourceBundle.java:353) at org.apache.ws.security.components.crypto.CredentialException.getMessage(CredentialException.java:111) at org.apache.ws.security.components.crypto.CredentialException.<init>(CredentialException.java:87) at org.apache.ws.security.components.crypto.CredentialException.<init>(CredentialException.java:62) at com.eviware.soapui.impl.wsdl.support.wss.crypto.KeyMaterialWssCrypto$KeyMaterialCrypto.load(KeyMaterialWssCrypto.java:323) at org.apache.ws.security.components.crypto.Merlin.loadProperties(Merlin.java:190) at org.apache.ws.security.components.crypto.Merlin.<init>(Merlin.java:140) at org.apache.ws.security.components.crypto.Merlin.<init>(Merlin.java:135) at com.eviware.soapui.impl.wsdl.support.wss.crypto.KeyMaterialWssCrypto$KeyMaterialCrypto.<init>(KeyMaterialWssCrypto.java:308) at com.eviware.soapui.impl.wsdl.support.wss.crypto.KeyMaterialWssCrypto$KeyMaterialCrypto.<init>(KeyMaterialWssCrypto.java:304) at com.eviware.soapui.impl.wsdl.support.wss.crypto.KeyMaterialWssCrypto.getCrypto(KeyMaterialWssCrypto.java:106) at com.eviware.soapui.impl.wsdl.support.wss.crypto.KeyMaterialWssCrypto.getCrypto(KeyMaterialWssCrypto.java:47) at com.eviware.soapui.impl.wsdl.support.wss.entries.WssEntryBase$KeyAliasComboBoxModel.update(WssEntryBase.java:277) at com.eviware.soapui.impl.wsdl.support.wss.entries.EncryptionEntry$InternalWssContainerListener.cryptoUpdated(EncryptionEntry.java:355) at com.eviware.soapui.impl.wsdl.support.wss.DefaultWssContainer.fireCryptoUpdated(DefaultWssContainer.java:382) at com.eviware.soapui.impl.wsdl.support.wss.crypto.KeyMaterialWssCrypto.setPassword(KeyMaterialWssCrypto.java:291) at com.eviware.soapui.impl.wsdl.panels.project.WSSTabPanel$CryptoTableModel.setValueAt(WSSTabPanel.java:746) at javax.swing.JTable.setValueAt(JTable.java:2740) at javax.swing.JTable.editingStopped(JTable.java:4722) at javax.swing.AbstractCellEditor.fireEditingStopped(AbstractCellEditor.java:141) at javax.swing.DefaultCellEditor$EditorDelegate.stopCellEditing(DefaultCellEditor.java:368) at javax.swing.DefaultCellEditor.stopCellEditing(DefaultCellEditor.java:233) at javax.swing.DefaultCellEditor$EditorDelegate.actionPerformed(DefaultCellEditor.java:385) at javax.swing.JTextField.fireActionPerformed(JTextField.java:508) at javax.swing.JTextField.postActionEvent(JTextField.java:721) at javax.swing.JTextField$NotifyAction.actionPerformed(JTextField.java:836) at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1664) at javax.swing.JComponent.processKeyBinding(JComponent.java:2879) at javax.swing.JComponent.processKeyBindings(JComponent.java:2926) at javax.swing.JComponent.processKeyEvent(JComponent.java:2842) at java.awt.Component.processEvent(Component.java:6282) at java.awt.Container.processEvent(Container.java:2229) at java.awt.Component.dispatchEventImpl(Component.java:4861) at java.awt.Container.dispatchEventImpl(Container.java:2287) at java.awt.Component.dispatchEvent(Component.java:4687) at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1895) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:762) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1027) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:899) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:727) at java.awt.Component.dispatchEventImpl(Component.java:4731) at java.awt.Container.dispatchEventImpl(Container.java:2287) at java.awt.Window.dispatchEventImpl(Window.java:2719) at java.awt.Component.dispatchEvent(Component.java:4687) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729) at java.awt.EventQueue.access$200(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:688) at java.awt.EventQueue$3.run(EventQueue.java:686) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87) at java.awt.EventQueue$4.run(EventQueue.java:702) at java.awt.EventQueue$4.run(EventQueue.java:700) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:699) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.run(EventDispatchThread.java:91) Could you please take care of it? Thx a lot!3.6KViews0likes0Comments