Android asmx希望头中包含哪些sessionid/cookie信息?

Android asmx希望头中包含哪些sessionid/cookie信息?,android,forms-authentication,asmx,ksoap2,android-ksoap2,Android,Forms Authentication,Asmx,Ksoap2,Android Ksoap2,在调用登录webmethod时,我正在保存http头cookie/sessionid信息,以便在formsauthentication保护的后续webmethod调用中将其发送回。我想我只需要知道正确的头值来保存,然后将它们发送回去 我正在使用ksoap2从android应用程序调用这些服务 当我在调用login时单步执行代码时。我看到两个设置Cookie标题项: Set-Cookie ASP.NET_SessionId=wblzzrtfmli4blku2dslw5iw; path=/; Htt

在调用登录webmethod时,我正在保存http头cookie/sessionid信息,以便在formsauthentication保护的后续webmethod调用中将其发送回。我想我只需要知道正确的头值来保存,然后将它们发送回去

我正在使用ksoap2从android应用程序调用这些服务

当我在调用login时单步执行代码时。我看到两个
设置Cookie
标题项:

Set-Cookie
ASP.NET_SessionId=wblzzrtfmli4blku2dslw5iw; path=/; HttpOnly

Set-Cookie
.ASPXAUTH=8264E023428DA853BB163504C0D375D792FC631BB873F04D196E04BAEDE7F7BB39BB5C840D0CD0613A0DD58B2456F12EE21F212D93457F3D6BC2FC343C6AE1E3DD97473B055B36379D178FE6C412EFF61CFCE7FACAF43EEAE85C46B5123CB97C3AFF156F54921993F4A2B85BEE239EAFB05AFFF58FBDA3B7EBDC59B5E0A614D8CC086B5C7DF3A884DE95DBE05F6A138DB97241666870AAF9320EDD; path=/; HttpOnly

根据和的理解,我必须使用
Cookie
Set Cookie
值返回到后续的webmethods。但正如你在上面看到的,我得到了两个集Cookie的标题项。那么,我应该发回哪一个?我可以原样发回它们吗?或者我需要去掉
.ASPXAUTH=
部分还是其他任何内容?

当我在web应用程序中从jQueryAjax调用安全服务时,我能够通过嗅探设置Cookie头的样子得到答案

基本上,我使用分号“;”连接了两个Set Cookie值

在登录时,我将其保存如下:

StringBuilder cookieBuilder=新建StringBuilder();
int intCookieValueCount=0;
for(对象标题:标题列表){
HeaderProperty HeaderProperty=(HeaderProperty)标题;
字符串headerKey=headerProperty.getKey();
字符串headerValue=headerProperty.getValue();
if(headerKey!=null){
if(headerKey.equals(“设置Cookie”))
{
如果(intCookieValueCount!=0){
cookieBuilder.append(“;”);
}                   
cookieBuilder.append(headerValue);
intCookieValueCount++;
}                   
}
}
AppSettings.setSessionCookie(cookieBuilder.toString());
在随后的电话中:

HeaderProperty headerPropertyObj=新的HeaderProperty(“Cookie”,AppSettings.getsessionokie());
@抑制警告(“原始类型”)
列表标题列表=新的ArrayList();
headerList.add(headerPropertyObj);
调用(SOAP_操作、信封、标题列表);