Current location: Hot Scripts Forums » Programming Languages » ASP » MSXML2.ServerXMLHTTP -- can't call self

MSXML2.ServerXMLHTTP -- can't call self

Reply
  #1  
Old 10-09-09, 04:16 PM
HammondEgger HammondEgger is offline
New Member
 
Join Date: Dec 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Spin MSXML2.ServerXMLHTTP -- can't call self

Hi Everyone,

I recently ran into a problem that other ASP developers have come across when trying to make use of MSXML2.ServerXMLHTTP. What I am trying to do is have my site read a page -- with arguments passed -- and then make that page the body of an e-mail.

Here's my code

vb Code:
  1. qpos = instr(myURL,"?")
  2. if qpos > 0 then
  3.     'If there is a ?, it means there are arguments so do this
  4.     base_url = "http://" & mid(myURL,1,qpos-1)        'the URL without args
  5.     args = mid(myURL,qpos+1)                    'The rest of the args
  6.     'Make the call...
  7.     set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
  8.     xmlhttp.open "GET", base_url, false
  9.         xmlhttp.send args
  10.         myMail.HTMLBody = xmlhttp.responseText
  11.         set xmlhttp = nothing
  12. else
  13.     myMail.CreateMHTMLBody myURL        'Get the body from this page...no args
  14. end if

The problem, from what I've read, centers around the functionality of MSXML2.ServerXMLHTTP which prevents it from being used to connect to its own address. So, I can read the contents of other site's pages, but not my own.

I need this ability since the pages are not just used as e-mail content, they are pages that people look at directly from time to time so I'd like to use those pages rather than have two sets of display code for the output.

Can anyone suggest a workaround for me or let me know what I'm doing wrong?

Thanks!
Reply With Quote
  #2  
Old 10-09-09, 05:43 PM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 2,836
Thanks: 13
Thanked 11 Times in 10 Posts
Quote:
Originally Posted by HammondEgger View Post
The problem, from what I've read, centers around the functionality of MSXML2.ServerXMLHTTP which prevents it from being used to connect to its own address. So, I can read the contents of other site's pages, but not my own.
Is this a bug, or a deliberate design feature (perhaps for security?)

If it's a bug, there may be a patch. If it's a design feature, you may need to use an alternate way of connecting, perhaps via cURL (PHP). I'm not familiar with MSXML2.ServerXMLHTTP, so hopefully someone else can offer some suggestions.
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data (scroll down)
Reply With Quote
  #3  
Old 10-12-09, 12:24 PM
HammondEgger HammondEgger is offline
New Member
 
Join Date: Dec 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by End User View Post
Is this a bug, or a deliberate design feature (perhaps for security?)

If it's a bug, there may be a patch. If it's a design feature, you may need to use an alternate way of connecting, perhaps via cURL (PHP). I'm not familiar with MSXML2.ServerXMLHTTP, so hopefully someone else can offer some suggestions.
From what I've read, it's not a bug, but a "design feature" -- amazingly enough. So, I am looking for a workaround. If you know one, please let me know.

Thanks.
Reply With Quote
Reply

Bookmarks

Tags
asp, email, xmlhttp


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Centering Website On Visitors Monitor? jdlev HTML/XHTML/XML 8 01-05-09 09:18 PM
[SOLVED] CSS - How can I get it to stay unique to a single div layer? jdlev CSS 6 11-20-08 02:51 PM
a.c. 50Hz voltage asm trouble steph6 Other Languages 0 04-09-08 06:17 AM
Asembly Language Help needed..Urgent..plzzzz paritoshcool Other Languages 1 11-27-07 08:07 AM
TreeView Control - Background Image? tim8w Windows .NET Programming 1 04-11-07 01:43 PM


All times are GMT -5. The time now is 05:29 AM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2 (Unregistered)