Sep 27, 2012, 5:44 PM
[CLOSED] Ext.net.DirectMethod.request webservice call and isUpload
Hi
Using the examples https://examples2.ext.net/#/Events/D...ds/WebService/
I am calling a WebService Endpoint from a DirectMethod, only difference is my service returns the actual file for download from the asmx file. Here is the function and I've tested it without problem by called it directly.
I know I need isUpload = true somewhere, otherwise I'm going to get BadResponse. However doesn't matter if I put isUpload or not in the following code, it still return BADRESPONSE: Cannot read property 'documentElement' of null
It seems that DirectMethod.request doesn't read that isUpload parameter.... where should I put that? I've spend long time trying to figure that out but no joy. Thank you very much
Using the examples https://examples2.ext.net/#/Events/D...ds/WebService/
I am calling a WebService Endpoint from a DirectMethod, only difference is my service returns the actual file for download from the asmx file. Here is the function and I've tested it without problem by called it directly.
[WebMethod]
public void DownloadScript(string script)
{
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Charset = "UTF-16";
HttpContext.Current.Response.ContentType = "application/x-pmt; charset=\"UTF-16\"";
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.Unicode;
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename="+ ts.Name+ ".pmt");
HttpContext.Current.Response.BinaryWrite(System.Text.Encoding.Unicode.GetPreamble());
HttpContext.Current.Response.Write(script);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End();
}
I know I need isUpload = true somewhere, otherwise I'm going to get BadResponse. However doesn't matter if I put isUpload or not in the following code, it still return BADRESPONSE: Cannot read property 'documentElement' of null
MyControl.Listeners.Click.Handler = @"
Ext.net.DirectMethod.request({
url : '/TestScriptWS.asmx/DownloadScript',
isUpload : true,
cleanRequest : true,
json : true,
params : {
script : '1234'
}
});
";
It seems that DirectMethod.request doesn't read that isUpload parameter.... where should I put that? I've spend long time trying to figure that out but no joy. Thank you very much
Last edited by Daniil; Sep 28, 2012 at 9:12 AM.
Reason: [CLOSED]