Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.18 KB | None | 0 0
  1. <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  2. <soap:Body>
  3. <GetCitiesByCountryResponse xmlns="http://www.webserviceX.NET">
  4. <GetCitiesByCountryResult><NewDataSet>
  5. <Table>
  6. <Country>British Indian Ocean Territory</Country>
  7. <City>Diego Garcia</City>
  8. </Table>
  9. <Table>
  10. <Country>India</Country>
  11. <City>Ahmadabad</City>
  12. </Table>
  13. <Table>
  14. <Country>India</Country>
  15. <City>Akola</City>
  16. </Table>
  17. </NewDataSet></GetCitiesByCountryResult>
  18. </GetCitiesByCountryResponse>
  19. </soap:Body>
  20. </soap:Envelope>
  21.  
  22. import groovy.sql.Sql
  23. def sql = Sql.newInstance('jdbc:mysql://localhost:3306/weather', 'root', 'security', 'com.mysql.jdbc.Driver')
  24. def response = context.expand( '${GetCitiesByCountry#Response}' )
  25. def xml = new XmlSlurper().parseText(response).Body.GetCitiesByCountryResponse.GetCitiesByCountryResult.NewDataSet.Table
  26. //log.info xml
  27. xml.each{ node ->
  28. sql.execute("INSERT INTO indcit(country,city) VALUES (?,?)" ,[node.Country, node.City])
  29. //sql.execute("INSERT INTO indcit(country,city) VALUES (${node.Country},${node.City})")
  30. //log.info node.Country
  31. //log.info node.City
  32. }
  33.  
  34. Thu Mar 03 01:16:36 IST 2016:ERROR:java.sql.SQLException: Invalid argument value: java.io.NotSerializableException
  35. java.sql.SQLException: Invalid argument value: java.io.NotSerializableException
  36. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
  37. at com.mysql.jdbc.PreparedStatement.setSerializableObject(PreparedStatement.java:3415)
  38. at com.mysql.jdbc.PreparedStatement.setObject(PreparedStatement.java:3066)
  39. at groovy.sql.Sql.setObject(Sql.java:3655)
  40. at groovy.sql.Sql.setParameters(Sql.java:3620)
  41. at groovy.sql.Sql.getPreparedStatement(Sql.java:3881)
  42. at groovy.sql.Sql.getPreparedStatement(Sql.java:3928)
  43. at groovy.sql.Sql.execute(Sql.java:2287)
  44. at groovy.sql.Sql$execute.call(Unknown Source)
  45. at Script62$_run_closure1.doCall(Script62.groovy:7)
  46. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  47. at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  48. at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  49. at java.lang.reflect.Method.invoke(Unknown Source)
  50. at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
  51. at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
  52. at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
  53. at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
  54. at groovy.lang.Closure.call(Closure.java:411)
  55. at groovy.lang.Closure.call(Closure.java:427)
  56. at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1325)
  57. at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1297)
  58. at org.codehaus.groovy.runtime.dgm$148.doMethodInvoke(Unknown Source)
  59. at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
  60. at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
  61. at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149)
  62. at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
  63. at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
  64. at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54)
  65. at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
  66. at Script62.run(Script62.groovy:6)
  67. at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:92)
  68. at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:141)
  69. at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:250)
  70. at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  71. at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  72. at java.lang.Thread.run(Unknown Source)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement