c# - How to add a additional parameter to Soap header -
i have application connects service. want add together additional parameter soap header, should add together to?
protected override webrequest getwebrequest(uri uri) { //apptoken name sent instead of caller app name - 10.1 this.requestsoapcontext.addressing.from = new uri(serviceconfiguration.apptoken, urikind.relative); webrequest req = base.getwebrequest(uri); req.headers.add(serviceconfiguration.header_cookie_name_c, serviceconfiguration.header_cookie_value); req.method = serviceconfiguration.request_method; req.contenttype = serviceconfiguration.request_content_type; string smsession = getsmsessioncookie(); if (smsession != "") { req.headers.add(serviceconfiguration.header_cookie_name_c, smsession); } m_webrequest = req; homecoming req; }
i have in 1 of web service class. sense seems http header.
i have in class have constants specified.
public const string request_method = "post"; public const string request_content_type = "text/xml"; public const string header_soap_action_name = "soapaction"; public const string header_soap_action_value = "/"; public const string header_cookie_value = "smchallenge=yes"; public const string header_application_name = "application_name"; public const string header_application_value = "xls"; public const string cookie_smsession = "smsession="; public const string header_cookie_name_c = "cookie"; public const string header_cookie_name_setc = "set-cookie"; public const string header_cookie_separator = ";";
can help me how add together additional parameter of own in soap request header?
i using winforms .net 4.0 c#.
i'm not sure if question right can add together custom header typing req.headers.add("customheadername","value");
c# .net winforms web-services asmx
No comments:
Post a Comment