1334
Views
0
Helpful
0
Comments

Options
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 01-24-2014 12:06 PM
Subject: RE: HTTPS Header Content-Length
Replied by: David Staudt on 08-06-2009 06:59:13 PM
The Content-length is almost always calculated and included automatically by the various HTTP, XML, SOAP or WSDL components used by applications. Very seldom does an app build the HTTP packet from raw bytes, but if it did, the Content-length is defined as: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13
In the example below, the visible text amounts to 421 octets, but this is likely inaccurate as the content will have bytes for hidden whitespace (CR/LF, tabs, etc.) and may be composed of unicode characters.
This document was generated from CDN thread
Created by: Keith Lunn on 08-06-2009 05:54:35 PM
Team,
When building the HTTPS header for an AXL request, where or how do you compute the value of content-length?
ex:
Content-type: text/xml
SOAPAction: "CUCM

Content-length: 613
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<axl:getPhone xmlns:axl="http://www.cisco.com/AXL/1.0"
xsi:schemaLocation="http://www.cisco.com/AXL/1.0 http://ccmserver/schema/axlsoap.xsd
" sequence="1234">
SEP222222222245
</axl:getPhone>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Where did the 613 come from? I'm not seeing any correlation between programmers code and the payload bytes for the SOAP message? What is the standard or best pratice?
Thanks!
Subject: RE: HTTPS Header Content-Length
Replied by: Keith Lunn on 08-06-2009 07:11:19 PM
Hi David, so what is the easiest way to caculate it? I never see anyone doing any calculations in their programs - it's like they "pulled the number out of their hat".
Thx,
K
Subject: RE: HTTPS Header Content-Length
Replied by: David Staudt on 08-06-2009 09:39:27 PM
In almost all cases, it is calculated and included in the HTTP request automatically. For example in the sample here:
http://developer.cisco.com/web/sxml/wikidocs?src=/wiki/display/SXML/IP+Address+Report#http://developer.cisco.com/wiki/display/SXML/IP%20Address%20Report?
The Java Axis 1.2 library abstracts use of XML/HTTP into some generic java methods. So here, where the AXL request is actually made by the app
>>cmselectresult = rport.selectCmDevice(new javax.xml.rpc.holders.StringHolder(""), cmSelectionCriteria);
the Axis library takes care of calculating the content-length and other HTTP headers; performs the low-level HTTP/TCP/CIP actions; eventually returning a fully formed java object called 'cmSelectResult'.
If you are actually building the HTTP packet from scratch, then the Content-length header would be just the count of the raw bytes that comprise the contents of the actual request (including CR/LF, whitespace, etc.)
Subject: RE: HTTPS Header Content-Length
Replied by: Keith Lunn on 09-06-2009 12:26:53 PM
OK, I did check out thtat wiki link and we don't use Java or c/c++ in our shop - its all vbscript and jscript. Although, I have not yet seen any of our programming examples indicate how they calculated this value - I guess I can take the payload string and use the length method and determine the number of bytes it contains ans set it before sending the HTTPS stream.
i.e. var inthttpsContentLength = strSoapPayload.length;
Subject: RE: HTTPS Header Content-Length
Replied by: Stephan Steiner on 10-06-2009 07:18:23 AM
I've looked at my code (which is an advanced version of the sample code from the SDK) and basically I use the length of the soap string that I generate. That may not be entirely accurate in all instances, but it has worked from CCM 4.0 till CCM 7.0 - and it corresponds to Cisco's sample so that should be okay.
Subject: RE: HTTPS Header Content-Length
Replied by: Keith Lunn on 10-06-2009 02:23:31 PM
Yes - thanks! I think I will do that pratice - get the string lenght in bytes of the SOAP payload and use that for the Content-Length. It almost seems like it doesn't matter what the AXL interface sees there.......who knows......a very poorely documented interface!
Labels: