Cannot access select server from WCF service

Discussions related to SoftPro Select Server development.

Moderator: Phil Barton

HariK
Posts: 25
Joined: Wed Feb 23, 2011 4:15 pm

Cannot access select server from WCF service

Post 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
roteague
Posts: 292
Joined: Thu Sep 25, 2008 4:49 pm
Location: Honolulu, Hawaii

Re: Cannot access select server from WCF service

Post 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.
Robert
HariK
Posts: 25
Joined: Wed Feb 23, 2011 4:15 pm

Re: Cannot access select server from WCF service

Post by HariK »

Still have the same issue
Thanks for the suggestion though, Robert
Hadi Chemaly

Re: Cannot access select server from WCF service

Post 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
HariK
Posts: 25
Joined: Wed Feb 23, 2011 4:15 pm

Re: Cannot access select server from WCF service

Post by HariK »

Hi Hadi - Select verison is 2.6.
I dont see anything in the event logs when this error occurs

-Hari
Mark McKenna

Re: Cannot access select server from WCF service

Post 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.
HariK
Posts: 25
Joined: Wed Feb 23, 2011 4:15 pm

Re: Cannot access select server from WCF service

Post 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
mrisen
Posts: 98
Joined: Wed Jul 25, 2012 7:01 pm

Re: Cannot access select server from WCF service

Post 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."}
john.morton
Posts: 89
Joined: Wed Nov 16, 2011 11:51 am

Re: Cannot access select server from WCF service

Post 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.
mrisen
Posts: 98
Joined: Wed Jul 25, 2012 7:01 pm

Re: Cannot access select server from WCF service

Post 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.
Post Reply