|
| |
|
|
rage2001
Posts: 124 Joined: 1/12/2005 Status: offline
|
Complicated ASP Call - 8/7/2006 17:38:06
I have no idea if this can be done... But this is what I want to try to do. I want to send a request from one web server to another secure webserver, which accesses an oracle database function and then send info back to the original web server. THis is what I am thinking, but do not know how to execute it: so we got 2 web servers: Web Server 1 (Not Secure) Web Server 2 (Secure) So on Web Server 1 I am writing an ASP script. In this script I want to send out a request to Web Server 2 like this maybe: (https://www.test.ca/ts.php?id=01). Once it gets here, it executes the the php script or asp, with the id given. This script accesses the oracle database. Then returns the information back to the original web server (Web Server 1).... Make sense? Please do not ask why this is being done. This is the only way I can see doing this. Can anyone help with this?> Thanks rage
|
|
|
|
rage2001
Posts: 124 Joined: 1/12/2005 Status: offline
|
RE: Complicated ASP Call - 8/7/2006 18:04:10
Thanks! I have no idea what the other server is using right now. I will be finding out tommorrow to be sure. I will give this a test, and hopefully this is what I need. If any others have any input, just post... THanks rage
|
|
|
|
rage2001
Posts: 124 Joined: 1/12/2005 Status: offline
|
RE: Complicated ASP Call - 8/7/2006 18:15:34
Just a few questiosn spooky Do I need to install anything for this on eithert server? Then, is this how it works the first block of code sends the data to the second server. The second script is on the second server. It executes, and sends the response back to objHttp.responseText. Now if i am not mistaken, I could return a HUGE string for: objHttp.responseText correct? Then I could parse this? I guess the second page could be PHP couldn't it? I mean, you are only opening a page, and telling it to use ID=12 or whatever... so php might work for the second page. Thanks rage
|
|
|
|
yogaboy
Posts: 377 Joined: 5/22/2004 Status: offline
|
RE: Complicated ASP Call - 8/7/2006 18:27:03
it doesn't matter what the other server is running as long as it defines some sort of rules for you both to stick to in the xml. They will expose public properties and methods that you can access, and tell you what to send to use them. It will be processed and then sent back to you in the pre-defined form. It most likely will be a long string, and you will use the MS XML DOM. It's called a web service. They're big in dotNet right now, and you get some Java ones too. Don't hear of it a lot with PHP or ASP.
< Message edited by yogaboy -- 8/7/2006 18:53:50 >
|
|
|
|
rage2001
Posts: 124 Joined: 1/12/2005 Status: offline
|
RE: Complicated ASP Call - 8/8/2006 17:39:27
Thanks for the help! Spooky. That worked perfect. Seems to be exactly what I needed! Thanks again. Steve
|
|
|
|
rage2001
Posts: 124 Joined: 1/12/2005 Status: offline
|
RE: Complicated ASP Call - 8/15/2006 9:59:29
Spookey, got a question. Can't figure something out. Once, I use the Msxml2.ServerXMLHTTP, I get the data back from the screen and it looks something like this: Firstname Lastname Middlename Last Term: 200503 - Y So anyway I parse it quickly like this: findBreak=instr(RecordID,"Last Term:") name=Trim(mid(RecordID,1,findBreak-1)) leftover=trim(mid(RecordID,findBreak)) so it will give me Firstname Lastname Middlename for name Now, here is my problem. If people have a ' or a - in their name, it is going to screw something up on me. So I thought I would try this: name = Replace(name,"-","") name = Replace(name,"'","") When I do this, I get an error in my script for some reason. I get: Microsoft VBScript runtime error '800a000d' Type mismatch I do not understand why. I want ot basically get rid of any - and ' in the name. Can anyone help? THanks
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Complicated ASP Call - 8/15/2006 10:08:47
quote:
name = Replace(name,"-","") Have you confirmed you have a valid string there? Try response.write(name) right before that to be sure there is really something there.
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
rage2001
Posts: 124 Joined: 1/12/2005 Status: offline
|
RE: Complicated ASP Call - 8/15/2006 10:18:39
Yes there is sometheing there. I can do: response.write name and it works fine. I can also check to see if somethign exists in the string using instr, all that works. The replace just wont work.
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Complicated ASP Call - 8/15/2006 10:25:04
That looks totally fine to me. How about trying this: ... name = cstr(name) name = replace(name,"-","") ... That any better?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
rage2001
Posts: 124 Joined: 1/12/2005 Status: offline
|
RE: Complicated ASP Call - 8/15/2006 17:56:54
Nope, tried it, didnt work.. I have no idea whats upo with this... to avoid it for now, I am using: if instr(name,"-") then replace(name,"-","") end if if instr(name,"'") then replace(name,"'","") end if I do not know if this helps or not... But so far everything passed to name so far, has NOT contained a - or a ' .... they have been just names liek stephen brown ... The type Mismatch error is really confusing me... so i am assuming now, even though my script works fine for names without - or ' ... it will again not work for names that will contain - or '
|
|
|
|
rage2001
Posts: 124 Joined: 1/12/2005 Status: offline
|
RE: Complicated ASP Call - 8/15/2006 18:43:14
I had it called nameString the last time I tried... same prob I dont understand why the error.. I can check if somethign is in the string... I can do other things... but when I put that in, it doesnt work...
|
|
|
|
rage2001
Posts: 124 Joined: 1/12/2005 Status: offline
|
RE: Complicated ASP Call - 8/15/2006 19:01:57
like this is what I really don';t understand... as a test, I tested my parsing of the Msxml2.ServerXMLHTTP in a small script. So i took in what I got, which I showed you above, and then I parsed it. Then I realized about the - and ' in their names... so i wrote the replace function.. just like this in my "TEST" script: stuCombo = "p_input=test"
url = "https://www.test.ca"
set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
objHttp.open "POST", url, false
objHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objHttp.Send stuCombo
RecordID = objHttp.responseText
if objHttp.status = 200 Then
if Instr(RecordID, "Invalid ID") then
response.write "Sorry, invalid info!"
else
findBreak=instr(RecordID,"Last Term:")
name=Trim(mid(RecordID,1,findBreak-1))
leftover=trim(mid(RecordID,findBreak))
name = replace(name,"-","")
name = replace(name,"'","")
strAryWords = Split(name, " ")
upperBound = Ubound(strAryWords)
firstName = strAryWords(0)
middleName = strAryWords(upperBound)
lastName = strAryWords(1)
strInitial = mid(middleName,1,1)
response.write name & "<br>"
response.write firstName & "<br>"
response.write lastName & "<br>"
response.write middleName & "<br>"
response.write strInitial & "<br>"
end if
else
response.write "Sorry, website down."
end if
set objHttp = nothing This worked fine!!!! then I placed it in my "actual" project, and that error comes up...
|
|
|
|
rage2001
Posts: 124 Joined: 1/12/2005 Status: offline
|
RE: Complicated ASP Call - 8/15/2006 19:14:25
I suppose as a work around I could not use the replace function... I could use something like this: nameString = "Terri-Lynn O'Quinn"
checkDash = instr(nameString,"-")
if checkDash > 0 then
nameString = Mid(nameString,1,checkDash-1) & Mid(nameString,checkDash+1,len(nameString))
end if
checkApost = instr(nameString,"'")
if checkApost > 0 then
nameString = Mid(nameString,1,checkApost-1) & Mid(nameString,checkApost+1,len(nameString))
end if
response.write nameString
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Complicated ASP Call - 8/16/2006 9:23:41
quote:
then I placed it in my "actual" project, and that error comes up... Are you using that same variable in other places or any variable at all? There is absolutely no reason that I can see why the code you posted doesn't work. This leaves some other piece of code external to this a possible suspect. Taking Spooky's suggestion 1 step further, try renaming *all* the variables you're using here to something else. That will help rule out 'external' variables and values being an issue.
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
rage2001
Posts: 124 Joined: 1/12/2005 Status: offline
|
RE: Complicated ASP Call - 8/16/2006 11:27:02
Changed them, still getting it. There is no reason to get this error. If the Replace line of code is NOT in there, it works fine in the "actual" project... It is only when the replace line of code is in there, it doesn't work. Anyways, I think the solution I used above will work. Instead of using replace, I use the Mid function to avoid the ' and - . Wil lsee if that works.
|
|
|
|
rage2001
Posts: 124 Joined: 1/12/2005 Status: offline
|
RE: Complicated ASP Call - 8/20/2006 18:33:01
The solution I was going to try with the Mid function instead of the Replace worked fine. No errors.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|