Need help with converting a String Property to Integer while Sending a soap request
Hi,
I am new to Soap UI and am trying the following scenario -
Scenario: Read an excel file for the data to be used in the Soap requests and also which Test steps are to be executed and then execute the same.
WSDL used:http://www.dneonline.com/calculator.asmx?WSDL
Issue: setPropertyValue() takes in only String parameters from what I understand so it looks like the integer data from the excel is stored in string format in the properties created. The Soap requests in questions need integer data but when I import the data into the requests using property expansion,the data loaded is in string format which leads to the following fault string being returned. How do I get past this issue?
<faultstring>System.Web.Services.Protocols.SoapException: Server was unable to read request. ---> System.InvalidOperationException: There is an error in XML document (5, 31). ---> System.FormatException: Input string was not in a correct format. at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.Xml.XmlConvert.ToInt32(String s) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read1_Add() at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer.Deserialize(XmlSerializationReader reader) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle) at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters() --- End of inner exception stack trace --- at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters() at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()</faultstring>
Excel data:
Groovy code:
Add Request:
I tried a few things like (${#testSuite#testData1}).toInteger() and ${=(int)#testSuite#testData1} but they didn't work.
Thanks for any help on this.
My mistake. It's #TestSuite# , I was trying with #testSuite#. Works properly now.