Click here to Skip to main content
14,271,130 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi ,
I am trying to access "https" server using xml+soap but every time i am getting 411 error saying Length Required, data should be chunked or length required ....

Please find my code below here i am providing Content-Length for specifying length and Transfer-Encoding for chunked data but i am not able to resolve it.

header1 = "Accept: text/xml,application/soap+xml\r\n";
header2 = "Content-Type: text/soap+xml; charset=utf-8\r\n";
header3 = "SOAPAction=\"GetServiceConfiguration\"\r\n";
header4 = "Content-Length: 2147483647\r\n";
header5 = "Transfer-Encoding: chunked\r\n";

csXmlRequest = "<?xml version=\"1.0\" encoding=\"utf-8\"? >";
csXmlRequest +=	"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";

csXmlRequest +=	"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" ";

csXmlRequest +=	"xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" ";

csXmlRequest +=	"xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\" ";

csXmlRequest += "xmlns:m=\"http://schemas.microsoft.com/exchange/services/2006/messages\" >";
 csXmlRequest += "<soap:Header>";
 csXmlRequest += "<t:RequestServerVersion Version=\"Exchange2010\" />";
csXmlRequest += "</soap:Header>";
csXmlRequest += "<soap:Body>";
csXmlRequest += "<m:GetServiceConfiguration>"; 
csXmlRequest += "<m:ActingAs>";
csXmlRequest += "<t:EmailAddressType>xxx@yyy.com</t:EmailAddressType>";
csXmlRequest += "<t:RoutingType>SMTP</t:RoutingType></m:ActingAs>";
csXmlRequest += "<m:RequestedConfiguration>";
csXmlRequest += "<ConfigurationName>MailTips</ConfigurationName>";
csXmlRequest += "<m:ConfigurationName>UnifiedMessagingConfiguration</m:ConfigurationName>";
csXmlRequest += "</m:RequestedConfiguration></m:GetServiceConfiguration></soap:Body></soap:Envelope>";


Any help is greatly appreciated.

Thanks.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100