Cannot access select server from WCF service
Moderator: Phil Barton
Cannot access select server from WCF service
We have a WCF service which is attempting to access select server.
It fails with an exception "Object reference not set to an instance of an object."
When this code (to access select server) is run in a windows app, it works fine.
Do we need any changes to make this work in a WCF/WebService.
Here is the code snippet:
NetworkCredential credential = new NetworkCredential("username", "Pwd", "Domain");
SelectServer selectServer = new SelectServer(null, "http://SOFTPROServer:8080", credential); //Fails here.....
Let me know if you have any questions
Some more details:
WCF is hotsed on a server which has Windows 7 32-bit OS
WCF project - Target Platform is set to x86
Thanks
Hari
It fails with an exception "Object reference not set to an instance of an object."
When this code (to access select server) is run in a windows app, it works fine.
Do we need any changes to make this work in a WCF/WebService.
Here is the code snippet:
NetworkCredential credential = new NetworkCredential("username", "Pwd", "Domain");
SelectServer selectServer = new SelectServer(null, "http://SOFTPROServer:8080", credential); //Fails here.....
Let me know if you have any questions
Some more details:
WCF is hotsed on a server which has Windows 7 32-bit OS
WCF project - Target Platform is set to x86
Thanks
Hari
Re: Cannot access select server from WCF service
Try this:
It works for us.
Code: Select all
NetworkCredential credential = new NetworkCredential(userName, userPasword, global::SoftPro.ClientModel.Constants.ServerDomain);
SelectServer server = new Select.Client.SelectServer(softProUri, credential);
// Do the authentication upon loading
server.EnsureAuthenticated();
Robert
Re: Cannot access select server from WCF service
Still have the same issue
Thanks for the suggestion though, Robert
Thanks for the suggestion though, Robert
Re: Cannot access select server from WCF service
Hi Hari,
What version of Select are you running? Also, can you dig out any event logs related to this error and post here? If there are any, that would help.
Thanks,
Hadi
What version of Select are you running? Also, can you dig out any event logs related to this error and post here? If there are any, that would help.
Thanks,
Hadi
Re: Cannot access select server from WCF service
Hi Hadi - Select verison is 2.6.
I dont see anything in the event logs when this error occurs
-Hari
I dont see anything in the event logs when this error occurs
-Hari
Re: Cannot access select server from WCF service
If you're able to catch the exception and provide stack details for the inner most one, that would help too. I think at that preliminary point most exceptions that occur are allowed to propagate out.
Re: Cannot access select server from WCF service
I have changed the account under which App Poll was running to an admin account and now I am able to acess select from WCF
Re: Cannot access select server from WCF service
Opening this thread back up again. I work with Hari and it's the same service. I don't want to run this under an administrative account and would like to identify the specific privilege(s) needed. The specific call that is falling is:
The credential username and password appear to be SoftPro credentials
The error being thrown is very exciting:
- var selectServer = new SelectServer(mConfig.SelectServerName, credential);
- mConfig.SelectServerName = "http://TEST-SOFTPRO2:8081"
credential.Domain = "[SERVER]"
credential.Password = "***"
credentail.UserName = "***"
The credential username and password appear to be SoftPro credentials
The error being thrown is very exciting:
- ex = {"Object reference not set to an instance of an object."}
-
- Posts: 89
- Joined: Wed Nov 16, 2011 11:51 am
Re: Cannot access select server from WCF service
The current version of the API does not support multithreading. Are you making these calls directly from the webservice? If so, you'll need to have something in the middle (like perhaps the windows service that you mentioned) handling the different threads, and ensuring that a single thread is being used against the Select server.
Re: Cannot access select server from WCF service
My apologies for not responding sooner. I never got an email on this so I guess I'll have to monitor it manually.
We are not multithreading as far as I am aware.
We are making calls directly from a middletier web service.
However, my question is about not using an administrative account. With an administrative account, it works fine. With a regular user account, it doesn't. I don't want to use an administrative account for this for security reasons and would like to know the specific privileges needed.
We are not multithreading as far as I am aware.
We are making calls directly from a middletier web service.
However, my question is about not using an administrative account. With an administrative account, it works fine. With a regular user account, it doesn't. I don't want to use an administrative account for this for security reasons and would like to know the specific privileges needed.