POST /browser/service1.asmx HTTP/1.1
Host: 192.168.0.13
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/Addition"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Addition xmlns="http://tempuri.org/">
<num1>int</num1>
<num2>int</num2>
</Addition>
</soap:Body>
</soap:Envelope>
If I understood correctly, you could use a method like below for setting different HTTP headers:
...
void CHTTPClientEngine::SetHeaderL(RHTTPHeaders aHeaders,
TInt aHdrField,
const TDesC8& aHdrValue)
{
RStringF valStr = iSession.StringPool().OpenFStringL(aHdrValue);
CleanupClosePushL(valStr);
THTTPHdrVal val(valStr);
aHeaders.SetFieldL(iSession.StringPool().StringF(aHdrField,
RHTTPSession::GetTable()), val);
CleanupStack::PopAndDestroy(); // valStr
}
...
And call it simply with:
...
RHTTPHeaders hdr = iTransaction.Request().GetHeaderCollection();
SetHeaderL(hdr, HTTP::EUserAgent, KUserAgent);
SetHeaderL(hdr, HTTP::EAccept, KAccept);
SetHeaderL(hdr, HTTP::EContentType, aContentType);
...
where
const TDesC8& aContentType
RHTTPTransaction iTransaction;
and constants:
_LIT8(KUserAgent, "MyHTTPClient 1.2.3");
// Accept all content types.
_LIT8(KAccept, "*/*");
...
void CHTTPClientEngine::SetHeaderL(RHTTPHeaders aHeaders,
TInt aHdrField,
const TDesC8& aHdrValue)
{
RStringF valStr = iSession.StringPool().OpenFStringL(aHdrValue);
CleanupClosePushL(valStr);
THTTPHdrVal val(valStr);
aHeaders.SetFieldL(iSession.StringPool().StringF(aHdrField,
RHTTPSession::GetTable()), val);
CleanupStack::PopAndDestroy(); // valStr
}
...
And call it simply with:
...
RHTTPHeaders hdr = iTransaction.Request().GetHeaderCollection();
SetHeaderL(hdr, HTTP::EUserAgent, KUserAgent);
SetHeaderL(hdr, HTTP::EAccept, KAccept);
SetHeaderL(hdr, HTTP::EContentType, aContentType);
...
where
const TDesC8& aContentType
RHTTPTransaction iTransaction;
and constants:
_LIT8(KUserAgent, "MyHTTPClient 1.2.3");
// Accept all content types.
_LIT8(KAccept, "*/*");