determining-the-size-of-a-soap-request-with-coldfusion
Published: 11-Jan-2012
Tags: Coldfusion , Performance , SQL Server
Tags: Coldfusion , Performance , SQL Server
Recently I was working with some SQL Server SOAP webservices that another developer had written a while back. On reviewing the code it quickly became apparent that a particular webservice call was returning way too much data.
To make my case as to why this needed to be changed I decided to find an average returned record size and how big the data transfer was for it.
<!--- Get some data from the soap webservice --->
<cfinvoke webservice="webserviceName" method="someMethod" returnVariable="resultSet">
<!--- Some arguments --->
</cfinvoke>
<!--- Get the data xml from the resultset --->
<cfset aDataset = resultSet.getSqlRowSet().get_any() />
<cfset xmlData = xmlParse(aDataset[3]) />
<!--- Convert the data xml to a string --->
<cfset thestring = toString(xmlData)>
<!--- Convert character count to bytes --->
<cfset bytesLen = len(thestring) * 8>
<!--- Convert bytes to kilobytes --->
<cfset kbytesLen = bytesLen/1024>
<!--- Convert kilobytes to megabytes --->
<cfset mbytesLen = kbytesLen/1024>
<cfoutput>
<p>
bytes: #bytesLen#<br/>
kilobytes: #kbytesLen#<br/>
megabytes: #mbytesLen#
</p>
</cfoutput>
I know its pretty simple code but it did its job and proved that the current webservices needed to be reworked so maybe it will help out someone else in a similar position in the future.
Follow Me
Archives Blog Listing
- 2012
- February
- January
- 2011
- December
- November
- September
- August
- July
- June
- Understanding The Different CFC Instantiation Behaviours
- Dont Call Us PIIGS
- Be Careful With ColdFusion Date Validation
- CF9 CF8 Railo Multiserver Install Under JRUN
- Your Privacy vs Technology
- How To Install CouchDB On Slackware
- Fixing Retweet.js
- Programmers Put Down The Keyboard
- How To Create A Virtual CFIDE Directory Mapping In Apache
- May
- April
- March
- February
- January
- 2010
- December
- November
- October
- September
Tag Listing
- America (3)
- Apache (11)
- Cassandra (2)
- cfobjective (1)
- Coldfusion (35)
- CouchDB (1)
- Design (8)
- Finances (2)
- Frameworks (2)
- Humour (1)
- IIS (4)
- Ireland (3)
- Java (9)
- JQuery (1)
- JRUN (1)
- Linux (7)
- Migration (2)
- muracms (1)
- MySQL (7)
- Networking (1)
- Open Source (2)
- Opinion (2)
- Other (5)
- Performance (5)
- personal (1)
- Privacy (1)
- Railo (9)
- Rant (9)
- Security (11)
- SEO (6)
- Slackware (9)
- Social Networking (1)
- SOLR (1)
- SQL (2)
- SQL Server (8)
- Subversion (4)
- Windows (2)