Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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";

XML
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900