Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Wed, 23 Apr 2008 12:24:42 +0800,    group: microsoft.public.xml        back       


MSXML2.XMLHTTP usable under asynchronous pluggable protocol?   
Hi,

I'm working on a project that uses asynchronous pluggable protocol (APP) to 
display data. One of the features require us to POST a javascript-generated 
xml to our protocol://handler/ . So we tried putting the following 
javascript:

var r = new XMLHttpRequest;
r.open("POST", "/handler/test/", false);
r.send("my stuff");

The current page url is something like protocol://handler/navigate/100 .

But this doesn't seem possible. I got an "Access is Denied" error on the 
line of "r.send();". IE prompt me and asked if I would like to continue run 
the scripts on this page. It didn't prompt me to debug though.

If I change "new XMLHttpRequest" to "new ActiveXObject("MSXML2.XMLHTTP")", 
I'll get the same error box but with "Permission Denied" error.

I would like to know if it's possible to use MSXML2.HTTP at all on APPs? If 
so, what should I do to find the cause of this access denied error? Thanks.

-- 
Best regards,
Bill Holt
date: Wed, 23 Apr 2008 12:24:42 +0800   author:   Bill Holt mailbill(NOSPAM)@21cn.com.nospam

Re: MSXML2.XMLHTTP usable under asynchronous pluggable protocol?   
>
> I would like to know if it's possible to use MSXML2.HTTP at all on APPs? 
> If so, what should I do to find the cause of this access denied error? 
> Thanks.
>
> -- 

I'm getting somewhere. In IInternetProtocolInfo::ParseUrl, I mapped my 
protocol to http during the PARSE_SECURITY_DOMAIN parse action. Now the 
access denied error went away.

But another problem rises up. The call of "r.send();" never returns. I 
trapped IInternetProtocol::Read and IInternetProtocolRoot::Start . It looks 
like they are both working okay. In Start(), I put the following procedures:

pIProtSink->ReportProgress(BINDSTATUS_FINDINGRESOURCE, L"");
pIProtSink->ReportProgress(BINDSTATUS_CONNECTING, L"");
pIProtSink->ReportProgress(BINDSTATUS_SENDINGREQUEST, L"");
pIProtSink->ReportProgress(BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE, 
L"text/xml");
pIProtSink->ReportData(BSCF_FIRSTDATANOTIFICATION, 0, m_contentsize);
pIProtSink->ReportData(BSCF_LASTDATANOTIFICATION | BSCF_DATAFULLYAVAILABLE, 
m_contentsize, m_contentsize);

In Read(), I discovered that it's called twice, with requesting size(cb) set 
to 4096. First call, I used memcpy to copy this content "<?xml 
version=\"1.0\"?><something></something>" to the output buffer. In the next 
call, I returned S_FALSE.

Everything seemed normal, but "r.send();" never returned. What can be the 
cause of this problem?

Thanks,
Bill Holt
date: Wed, 23 Apr 2008 14:50:09 +0800   author:   Bill Holt mailbill(NOSPAM)@21cn.com.nospam

Re: MSXML2.XMLHTTP usable under asynchronous pluggable protocol?   
>
> Everything seemed normal, but "r.send();" never returned. What can be the 
> cause of this problem?
>

Hmm, I solved this myself, by putting:

pIProtSink->ReportResult(S_OK, 0, NULL);

at the end of IInternetProtocolRoot::Start . This appeared to be required 
according to the documentation.

Thanks anyway,
Bill Holt
date: Wed, 23 Apr 2008 16:57:56 +0800   author:   Bill Holt mailbill(NOSPAM)@21cn.com.nospam

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us