468,251 Members | 1,365 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,251 developers. It's quick & easy.

Calling web Service, from one error to another "Proxy Access Denied" into "The underlying connection was closed"

Hi There,

I've generated a C# file from a wsdl file using wsdl.exe utility.
Then I created a console application and made a call to the method
generated, first I got the error:

"The request failed with HTTP status 407: Proxy Access Denied."

Then I added a proxy validating and proxy credentials and got this:

"The underlying connection was closed: An unexpected error occurred on
a receive."

I send you the code to see if you can help me on this one, please...

Thanks,

Luis Miguel Pinho

----------------------------------------------------------------

Z_PO_SyncService service = new Z_PO_SyncService();

WebProxy wp = new System.Net.WebProxy("172.28.6.2:80",true);
wp.Credentials = System.Net.CredentialCache.DefaultCredentials;

service.Proxy = wp;
ZLOTS a = new ZLOTS();
a.BATCH = "23";
ZLOTS b = new ZLOTS();
b.BATCH = "45";

ZLOTS[] input = new ZLOTS[]{a,b};
ZPOSLIST[] output = null;

try
{
service.Z_PO_RETURN_VERS2_OB_Sync(ref input,ref output);
}
catch(Exception ex)
{
Console.WriteLine("An error occured:");
Console.WriteLine("******************************* *******");
Console.WriteLine(ex.Message);
Console.WriteLine("******************************* *******");
return;
}

foreach(ZPOSLIST po in output)
{
Console.WriteLine(po.BATCH+"|"+po.EBELN+"|"+po.EBE LP+"|"+po.ELIKZ);
}

Nov 23 '05 #1
0 2285

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by ASP.Confused | last post: by
reply views Thread by ASP.Confused | last post: by
2 posts views Thread by Wimpie van Lingen | last post: by
1 post views Thread by Odd B Andersen | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.