Skip to content


WCF sample connection String ?

Adrian asked 7 years ago
I copied the code below from the from the SmartConnect manual .  I would like to try the command in Visual studio but the command is missing prentices and  “  causing syntax errors.
 System.Net.WebRequest request = System.Net.WebRequest.Create(“webservice.eonesolutions.request.Credentials = new System.Net.NetworkCredential(“username”,”password”,”domain”);
What is the correct Syntax?  Thanks
Patrick Roth Staff replied 7 years ago

I flipped in the online manual and don’t see code like you are trying to use above.
but the problem with the specific code you have above is exactly as you note.

remove the double quote after the .Create( statement since that isn’t a string.
And then you need to add a paren at the end because the .Create() method that you are calling doesn’t have its ending paren.

Lorren Zemke Staff answered 7 years ago
For that method to work, you need to replace the “username”, “password”, “domain” values with your actual variables or strings.
Here is Microsoft’s documentation on using the System.Net.WebRequest.Create method.
Adrian answered 7 years ago
Hello Lorren before I opened the case I replaced the values for username,password and domain.  I  received syntax error not and authentication error.  The C#  command string does not compile because of syntax issues not values.  
for instance 
Console.Writeline(“password”;    this line has a syntax error.

If you would like to submit an answer or comment, please sign in to the eOne portal.