Page 1 of 2

Cannot access select server from WCF service

Posted: Wed Mar 16, 2011 4:51 pm
by HariK
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

Re: Cannot access select server from WCF service

Posted: Wed Mar 16, 2011 5:41 pm
by roteague
Try this:

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();
It works for us.

Re: Cannot access select server from WCF service

Posted: Wed Mar 16, 2011 6:13 pm
by HariK
Still have the same issue
Thanks for the suggestion though, Robert

Re: Cannot access select server from WCF service

Posted: Thu Mar 17, 2011 11:30 am
by Hadi Chemaly
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

Re: Cannot access select server from WCF service

Posted: Thu Mar 17, 2011 11:35 am
by HariK
Hi Hadi - Select verison is 2.6.
I dont see anything in the event logs when this error occurs

-Hari

Re: Cannot access select server from WCF service

Posted: Thu Mar 17, 2011 5:40 pm
by Mark McKenna
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

Posted: Wed Mar 23, 2011 6:32 pm
by HariK
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

Posted: Thu Apr 11, 2013 1:33 pm
by mrisen
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:
  • var selectServer = new SelectServer(mConfig.SelectServerName, credential);
The values being passed are:
  • 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."}

Re: Cannot access select server from WCF service

Posted: Mon Apr 15, 2013 10:26 am
by john.morton
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

Posted: Tue Apr 23, 2013 2:08 pm
by mrisen
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.