Expect100Continue

P

Peter Huang

Hi Mike,

Now I am researching the issue and I will update you with new information
ASAP.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang

Hi

Now I am involving other person in this field. And we will update you with
new information ASAP.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
E

Ercan Turkarslan [MS]

Hi Mike,

HTTP error "417 Expectation Failed" is received, due proxy settings of your
web services connection. Unfortunately, Expect100Continue will not solve
your problem.

Are you setting proxy properly?

Could you send me the proxy setting code?

Thanks

Ercan Turkarslan (Siemens Business Services Inc.)
Microsoft Mobile Devices Division Developer Support
 
M

Mike

I am able to do HTTP Gets, I only get the error when doing a POST. Also,
the same code works at other locations.
 
E

Ercan Turkarslan [MS]

Could you clarify what the other locations are?

I still need to see how you are setting the proxy.

Thanks

Ercan Turkarslan (Siemens Business Services Inc.)
Microsoft Mobile Devices Division Developer Support
 
M

Mike

The other locations are other hospitals around the U.S. One is in Baton
Rouge, LA.

Here is the code I use to create a WebProxy object and assign it to a
WebRequest object:

myUri = New Uri(Utils.GetOption(cmd, "ProxyServer"))
' Associate the new Uri object to the myProxy object.

myProxy.Address = myUri

sProxyUser = Utils.GetOption(cmd, "ProxyUser")

If sProxyUser <> "" Then

sProxyDomain = Utils.GetOption(cmd, "ProxyDomain")

If sProxyDomain = "" Then

MyCred = New System.Net.NetworkCredential(sProxyUser, Utils.GetOption(cmd,
"ProxyPwd"))

Else

MyCred = New System.Net.NetworkCredential(sProxyUser, Utils.GetOption(cmd,
"ProxyPwd"), sProxyDomain)

End If

myProxy.Credentials = MyCred

myRequest.Credentials = MyCred



End If

myRequest.Proxy = myProxy
 
E

Ercan Turkarslan [MS]

Hi Mike,

Your proxy definition looks like correct.

Unfortunately, current version of .NET CF does not support NTLM
authentication. Could you double check which authentication does the proxy
server use?

Are you connecting from a .NET CF application at other locations?

Thanks

Ercan Turkarslan
 
M

Mike

There is no authentication going on because the user does not supply a
username or password and the HTTP GET's go through.
 
E

Ercan Turkarslan [MS]

Hi Mike,

According to your code you are retrieving ProxyUser and ProxyDomain values
from a class called Utils. And you are creating NetworkCredentials based on
those values. So your proxy definition contains uses a username and
password.

I would be grateful if you could check what is the authentication protocol
the proxy server is using.

I would appreciate if you could also take the proxy server out of the
picture and try to access the Web Services Server without proxy. Are you
able to successfully connect to the Web Services Server in that case?

Could you also tell me whether you are using .NET CF on other locations
from which you can access?

Thanks

Ercan Turkarslan
(e-mail address removed)

Mobile Devices Division Developer Support
 
M

Mike

It only does the NetworkCredentials If sProxyUser <> "" and at the hospital
in question, that variable is blank, so it is not assigning credentials.

I will try to find out the authentication protocol but it may take a while -
I don't know anyone who knows that information but I might be able to find
out.

I'm not trying to access a Web Services Server - it's acessing a
Linux/Apache server.

The code works without a proxy server and with other proxy servers, I'm
trying to get it to work with 1 particular proxy server.

Yes, I am using .NET CF at other locations successfully with and without
proxy servers.
 
E

Ercan Turkarslan [MS]

Hi Mike,

If the code works fine without the Proxy Server as you have stated, we
should concentrate on the Proxy Server first.

What is the Proxy Server?

What are the authentications supported by the Proxy Server? Current version
of .NET CF only supports digest authentication.

Does using the proxy server cause timeout?

Thanks

Ercan Turkarslan
Microsoft Mobile Devices Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Joined
Oct 6, 2005
Messages
1
Reaction score
0
ServicePointManager.Expect100Continue = false;

.NET automatically put an Expect: 100-continue
According to the RFC the proxy or webserver takes a look at the requests and headers and determines weather it can complete the request if it can not it closes the connection withing 100ms. This comes in handy when you are doing large posts. That way if the server can not fullfill the request it will close the connection after sending only the header information and before the client sends hords of data up to the server.
in C# v1.1 in the webrequest method there is an object ServicePointManager that contains a bool value to shut that feature off for the request. a like so:

ServicePointManager.Expect100Continue = false;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top