| Dart Home | PowerTCP Web for ActiveX | Custom Development | Reply | PowerTCP Web for ActiveX Topics | Forums |
| Author | Forum: PowerTCP Web for ActiveX Topic: ASP 0115 |
| User1033 Posts: 4 Member Since: 11/28/00 |
posted November 28, 2000 8:57 AM We use your web tool as an ActiveXDLL. The problem we are having is that the control appears to work fine for a random amount of time, but then it will suddenly crash our system. The biggest problem we have with this is that it totally takes out our web server when it goes down. We get an ASP Application Error in the Event Viewer. This occurs only when the control is called from an ASP page. When we run it in a batch process, this does not occur. Do you have any ideas what could be causing such erratic behavior, and any information at all on what ASP Error 0115 is. |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted November 28, 2000 9:02 AM I'm not sure what would cause that error. It could be one of the reasons why Microsoft recommends not using WININET.DLL in ASP. We use WININET.DLL in the HTTP control. You may want to try using the TCP control to do your Web stuff. Formulating a request is not that hard (I can give you examples if you want) |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted November 28, 2000 9:06 AM Looks like many others are having a problem: See this for a list of newsgroup questions: http://www.deja.com/dnquery.xp?QRY=ASP+%2B+0115&ST=MS&svcclass=dncurrent&DBS=2 |
| User1033 Posts: 4 Member Since: 11/28/00 |
posted November 28, 2000 9:26 AM Tony, Our needs are the following. We need to be able to post data to a page and receive a response. This would ideally occur on an ASP page. We do this for the following reason. When a new user registers with our site we also want to register them with our outsourced bulletin board site. In order to do this we post their information to that site behind the scenes. To make this immediate, we do it at the same time as they register with us. We are trying to do this with your control, and that is where we are running into problems. We can do the process in batch mode, but that is not ideal, and we will need to repeat this type of code numerous times. So I guess what I am saying is that we want to find a way to do this in ASP. Can the TCP control do this? |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted November 28, 2000 9:34 AM Here is an example of how to POST data using our TCP control in ASP: <% Dim Header Dim Body Dim SecureTcp1 Dim PostData Set Tcp1 = Server.CreateObject("Dart.Tcp.1") Set Header = Server.CreateObject("Dart.DartStream") Set Body = Server.CreateObject("Dart.DartStream") Tcp1.Trace "c:\post.txt",True, True, vbcrlf+"---> ", vbcrlf+"<--- " ' Data to Post PostData = "Item1=This%20is%20Item%201&Item2=This%20would%20be%20Item%202&Item3=And%20of%20course,%20this%20is%20Item%203" ' Connect Tcp1.Connect "www.dart.com", 80 ' Send Request Tcp1.Send "POST /PostSample.asp HTTP/1.0" + vbCrLf ' Send Required Header lines Tcp1.Send "Content-Type: application/x-www-form-urlencoded" + vbCrLf Tcp1.Send "Content-Length: " + cstr(len(PostData)) + vbCrLf + vbCrLf ' Send Postdata Tcp1.Send PostData ' Search for end of response header Tcp1.Search Header, vbcrlf + vbcrlf ' Get body Do While Tcp1.State <> tcpClosed Tcp1.Receive Body Loop ' Display Body Body.Position = 0 Response.Write Body.ReadString %> |
| User1033 Posts: 4 Member Since: 11/28/00 |
posted November 28, 2000 11:42 AM Following is my code using your TCP control. It is hanging. I believe it hangs at the do while loop. When I removed it, the code ran, but it failed every time. Any help is appreciated. on error resume next dim strName dim strPassword dim strEmail dim strNewName dim strResponse dim objLog Dim Header Dim Body Dim SecureTcp1 Dim PostData Set Tcp1 = Server.CreateObject("Dart.Tcp.1") Set Header = Server.CreateObject("Dart.DartStream") Set Body = Server.CreateObject("Dart.DartStream") strName="Name=" & session("Bid_name") & "" strNewName="Newname=" & wForm1("Bid_name").pObject.Value & "" strPassword="Password=" & wForm1("password").pObject.Value & "" strEmail="Email=" & wForm1("email").pObject.Value & "" if len(strPassword)>0 then PostData="" & strName & "&" & strNewName & "&" & strPassword & "&" & strEmail & "&Inactive=0" else PostData="" & strName & "&" & strNewName & "&" & strEmail & "&Inactive=0" end if Tcp1.Connect "208.185.149.219", 80 ' Send Request Tcp1.Send "POST /WebX?userModify HTTP/1.0" + vbCrLf ' Send Required Header lines Tcp1.Send "Content-Type: application/x-www-form-urlencoded" + vbCrLf Tcp1.Send "Content-Length: " + cstr(len(PostData)) + vbCrLf + vbCrLf ' Send Postdata Tcp1.Send PostData ' Search for end of response header Tcp1.Search Header, vbcrlf + vbcrlf ' Get body Do While Tcp1.State <> tcpClosed Tcp1.Receive Body Loop ' Display Body Body.Position = 0 strResponse = Body.ReadString if instr(1,strResponse,"~~Modified ")>0 then 'Success set objLog=server.CreateObject("omLog.Log") objLog.WriteLog "Modified","Success on user " & strName else 'Failure set objLog=server.CreateObject("omLog.Log") objLog.WriteLog "Modified", "Failure on user " & strName Err.Clear end if If (Err.Number <> 0) Then set objLog=server.CreateObject("omLog.Log") objLog.WriteLog "Modified","General Failure" & ": " & Err.Description Err.Clear end if |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted November 28, 2000 12:11 PM First, did the sample code I sent work (it did for me) Second, I see several things wrong with your code. It looks like there are places where you are trying to send quotes where you did not double them up properly. Example: If you actually want to send a quote by itself, it would actually be 4 quotes: strName = "" Newname = " + name + "" would be: strName = """ Newname = " + name + """" Also, in the example I sent, I incorrectly used a constant (tcpClosed) when I should have used the actual number. I works because ASP creates a new variable called tcpClosed which is 0. I would suggest that you write this in VB first (with Option Explicit) Once you get it working convert it to ASP. IMPORTANT: GET RID OF THE ON ERROR RESUME NEXT UNTIL YOU GET THIS WORKING!! |
| User1033 Posts: 4 Member Since: 11/28/00 |
posted November 29, 2000 8:19 AM The problem was the dim SecureTCP1 as opposed to dim TCP1. That fixed it. Thanks for the help. |
| Reply | PowerTCP Web for ActiveX Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|