Winsock Socket Error from embedded VB Form 
Author Message
 Winsock Socket Error from embedded VB Form

I set up my Socket call:

        winsockAuth.RemoteHost = 192.168.101.150
        winsockAuth.Protocol = sckTCPProtocol    
        winsockAuth.RemotePort = 80  'Port 80
        winsockAuth.Connect
        winsockAuth.SendData "GET MSBRemoteSB/offline_login.asp"

I receive this response in winsockAuth_DataArrival for:
winsockAuth.GetData strData

strData =

HTTP/1.1 400 Bad Request
Server: Microsoft-IIS/5.1
Date: Tue, 02 Apr 2002 23:35:23 GMT
Content-Type: text/html
Content-Length: 87

<html><head><title>Error</title></head><body>The parameter is
incorrect. </body></html>

I expect code along these lines:
? <?xml version="1.0" ?>
  <Result>
?  <code>1</code>
?  <message>Success</message>
? </Result>

When I try the URL in the PIE browser (to verify that it's not a
simple connection error) I receive:

 <?xml version="1.0" ?>1

What is puzzling is that the .asp that I call does not get any input
parameters (it's really just XML, no asp function yet).  This error
message seems to be coming from the socket.

Any ideas on why I am seeing this behavior?

Thanks for your help.  andrew



Tue, 28 Sep 2004 05:18:46 GMT  
 Winsock Socket Error from embedded VB Form
I may be wrong but I think that you have to include "HTTP/1.1" somehow in
the SendData 'GET' request. Also you might need to end the SendData string
with at least 1 vbCrLf, possibly 2.

Rick


Quote:
> I set up my Socket call:

>         winsockAuth.RemoteHost = 192.168.101.150
>         winsockAuth.Protocol = sckTCPProtocol
>         winsockAuth.RemotePort = 80  'Port 80
>         winsockAuth.Connect
>         winsockAuth.SendData "GET MSBRemoteSB/offline_login.asp"

> I receive this response in winsockAuth_DataArrival for:
> winsockAuth.GetData strData

> strData =

> HTTP/1.1 400 Bad Request
> Server: Microsoft-IIS/5.1
> Date: Tue, 02 Apr 2002 23:35:23 GMT
> Content-Type: text/html
> Content-Length: 87

> <html><head><title>Error</title></head><body>The parameter is
> incorrect. </body></html>

> I expect code along these lines:
> <?xml version="1.0" ?>
>   <Result>
>   <code>1</code>
>   <message>Success</message>
> </Result>

> When I try the URL in the PIE browser (to verify that it's not a
> simple connection error) I receive:

>  <?xml version="1.0" ?>1

> What is puzzling is that the .asp that I call does not get any input
> parameters (it's really just XML, no asp function yet).  This error
> message seems to be coming from the socket.

> Any ideas on why I am seeing this behavior?

> Thanks for your help.  andrew



Tue, 28 Sep 2004 13:40:57 GMT  
 Winsock Socket Error from embedded VB Form
I think you need: winsockAuth.SendData "GET /MSBRemoteSB/offline_login.asp.
I think there needs to be "/" after GET.

-Vladimir


Quote:
> I set up my Socket call:

>         winsockAuth.RemoteHost = 192.168.101.150
>         winsockAuth.Protocol = sckTCPProtocol
>         winsockAuth.RemotePort = 80  'Port 80
>         winsockAuth.Connect
>         winsockAuth.SendData "GET MSBRemoteSB/offline_login.asp"

> I receive this response in winsockAuth_DataArrival for:
> winsockAuth.GetData strData

> strData =

> HTTP/1.1 400 Bad Request
> Server: Microsoft-IIS/5.1
> Date: Tue, 02 Apr 2002 23:35:23 GMT
> Content-Type: text/html
> Content-Length: 87

> <html><head><title>Error</title></head><body>The parameter is
> incorrect. </body></html>

> I expect code along these lines:
> <?xml version="1.0" ?>
>   <Result>
>   <code>1</code>
>   <message>Success</message>
> </Result>

> When I try the URL in the PIE browser (to verify that it's not a
> simple connection error) I receive:

>  <?xml version="1.0" ?>1

> What is puzzling is that the .asp that I call does not get any input
> parameters (it's really just XML, no asp function yet).  This error
> message seems to be coming from the socket.

> Any ideas on why I am seeing this behavior?

> Thanks for your help.  andrew



Sat, 02 Oct 2004 05:07:10 GMT  
 Winsock Socket Error from embedded VB Form
Yes, that was it - thank you for your help.
Quote:

> I think you need: winsockAuth.SendData "GET /MSBRemoteSB/offline_login.asp.
> I think there needs to be "/" after GET.

> -Vladimir



> > I set up my Socket call:

> >         winsockAuth.RemoteHost = 192.168.101.150
> >         winsockAuth.Protocol = sckTCPProtocol
> >         winsockAuth.RemotePort = 80  'Port 80
> >         winsockAuth.Connect
> >         winsockAuth.SendData "GET MSBRemoteSB/offline_login.asp"

> > I receive this response in winsockAuth_DataArrival for:
> > winsockAuth.GetData strData

> > strData =

> > HTTP/1.1 400 Bad Request
> > Server: Microsoft-IIS/5.1
> > Date: Tue, 02 Apr 2002 23:35:23 GMT
> > Content-Type: text/html
> > Content-Length: 87

> > <html><head><title>Error</title></head><body>The parameter is
> > incorrect. </body></html>

> > I expect code along these lines:
> > <?xml version="1.0" ?>
> >   <Result>
> >   <code>1</code>
> >   <message>Success</message>
> > </Result>

> > When I try the URL in the PIE browser (to verify that it's not a
> > simple connection error) I receive:

> >  <?xml version="1.0" ?>1

> > What is puzzling is that the .asp that I call does not get any input
> > parameters (it's really just XML, no asp function yet).  This error
> > message seems to be coming from the socket.

> > Any ideas on why I am seeing this behavior?

> > Thanks for your help.  andrew



Sat, 02 Oct 2004 09:11:44 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. I have problem with VB embedded: winsock: error 10054

2. Socket flushing in VB (winsock)

3. (VB,Winsock) Extracting data from socket.

4. (VB,Winsock) Extracting data from socket.

5. Converting Crystal Report embedded in VB 6 to a VB .NET Web Form

6. Converting Crystal Report embedded in VB 6 to a VB .NET Web Form

7. Networking error using sockets in VB.Net

8. Passing parameters from embedded VB to embedded VC++

9. Embedding Outlook calendar in VB form

10. How to embed Excel books on vb form??

11. embedding another app's window in a VB form

12. Capturing the Tab key-press in a c++ ocx embedded in a vb form

 

 
Powered by phpBB® Forum Software