Select Server Connection failure
Moderator: Phil Barton
Select Server Connection failure
I recently upgraded to a new machine running Windows 7. I'm having a bit of problem connecting to the Select Server via the API, but I'm having trouble seeing where my configuration isn't correct. Here is the line that is throwing the error:
SelectServer server = new Select.Client.SelectServer(_softProUri, credential);
The error I get is:
Object reference not set to an instance of an object.
The stack trace is:
" at SoftPro.Select.Client.SelectServer.OnInitialize()\r\n at SoftPro.ClientModel.ServerObject.SoftPro.ClientModel.ISupportInit.Initialize(IServiceProvider sp)\r\n at SoftPro.Select.Client.SelectServer..ctor(IServiceProvider serviceProvider, Uri uri, ICredentials credentials)\r\n at SoftPro.Select.Client.SelectServer..ctor(Uri uri, ICredentials credentials)\r\n at TG.SoftPro.OrderLookup.SoftProOrder.LoadOrderTrackingService() in C:\\Projects\\SoftPro\\Code\\TG.SoftPro Solution\\TG.SoftPro.OrderLookup\\SoftProOrder.cs:line 308"
The User ID and Password are the default, the Uri is "http://computername:8080/SelectServer". I have no problem with the Select Client.
Any idea what I could be missing?
Thanks,
SelectServer server = new Select.Client.SelectServer(_softProUri, credential);
The error I get is:
Object reference not set to an instance of an object.
The stack trace is:
" at SoftPro.Select.Client.SelectServer.OnInitialize()\r\n at SoftPro.ClientModel.ServerObject.SoftPro.ClientModel.ISupportInit.Initialize(IServiceProvider sp)\r\n at SoftPro.Select.Client.SelectServer..ctor(IServiceProvider serviceProvider, Uri uri, ICredentials credentials)\r\n at SoftPro.Select.Client.SelectServer..ctor(Uri uri, ICredentials credentials)\r\n at TG.SoftPro.OrderLookup.SoftProOrder.LoadOrderTrackingService() in C:\\Projects\\SoftPro\\Code\\TG.SoftPro Solution\\TG.SoftPro.OrderLookup\\SoftProOrder.cs:line 308"
The User ID and Password are the default, the Uri is "http://computername:8080/SelectServer". I have no problem with the Select Client.
Any idea what I could be missing?
Thanks,
Robert
Re: Select Server Connection failure
We need a little bit more details to figure this one out:
- What version of Select are you running on your Windows 7 box?
- Are you running Windows 7 64-bit or 32-bit?
- Does the same code work on an older OS with the same version of Select installed?
Re: Select Server Connection failure
Sorry Hadi,
I'm running Select 2.4.30715.60 on Windows 7 Professional 64-bit. The code was originally developed on Windows XP and works fine there. I'm also confident with the URI, primarily because I convert the address string to a System.Uri before passing it into the SelectServer constructor.
Thanks,
I'm running Select 2.4.30715.60 on Windows 7 Professional 64-bit. The code was originally developed on Windows XP and works fine there. I'm also confident with the URI, primarily because I convert the address string to a System.Uri before passing it into the SelectServer constructor.
Thanks,
Robert
Re: Select Server Connection failure
Robert,
You no longer need the "/SelectServer" part at the end of the Server Uri.
Check out this thread for details.
You no longer need the "/SelectServer" part at the end of the Server Uri.
Check out this thread for details.
Re: Select Server Connection failure
Sorry, I'm not using the "/SelectServer", not sure why I wrote it down. Too busy I guess.Hadi Chemaly wrote:Robert,
You no longer need the "/SelectServer" part at the end of the Server Uri.
Check out this thread for details.
Robert
Re: Select Server Connection failure
Try redirecting the output path of your project to the SoftPro Select folder (if it's not already) and let me know if it helps:
In the meantime, I will set up a Windows 7 64-bit environment and try to run our ProFormApiSample.
Code: Select all
<OutputPath>$(ProgramFiles)\SoftPro\Select\</OutputPath>
Re: Select Server Connection failure
I run all my projects from the SoftPro directory, except for web services. In those cases I use SyncToy to keep the files sychronized between the SP directories and the webservice directories.Hadi Chemaly wrote:Try redirecting the output path of your project to the SoftPro Select folder (if it's not already) and let me know if it helps:
In the meantime, I will set up a Windows 7 64-bit environment and try to run our ProFormApiSample.Code: Select all
<OutputPath>$(ProgramFiles)\SoftPro\Select\</OutputPath>
I can get the ProFormApiSample to connect, although it throws an error on EnsureAuthenticated: ""Method not found: 'Boolean SoftPro.Administration.Common.IAuthorizationService.HasPermission(System.String, SoftPro.Security.Rights)'."
BTW, the ProFormApiSample sample included with the SDK is broken I had to take a bit of time fixing it before I could get it to run. The AssemblyInfo.cs files is in the wrong place, the project is missing a reference to SoftPro.ClientMode, all the assembly references are out of date, the server address is incorrect, and the client model constant is incorrect. It's still using the old code.
Robert
Re: Select Server Connection failure
The code works stand alone, but doesn't work when called from a Web Service. May be an issue with how IIS is configured.
Robert
Re: Select Server Connection failure
I never asked you how you have Select deployed in your environment. Are you running Select Services, Server and Client all on the same box?
Thanks for reporting the outdated code in the ProFormApiSample. We have already brought the code up to date for the upcoming release.
I'll ask around some other devs, and hopefully manage to repro your issue. Stay tuned.
Thanks for reporting the outdated code in the ProFormApiSample. We have already brought the code up to date for the upcoming release.
I'll ask around some other devs, and hopefully manage to repro your issue. Stay tuned.
Re: Select Server Connection failure
Thanks Hadi,Hadi Chemaly wrote:I never asked you how you have Select deployed in your environment. Are you running Select Services, Server and Client all on the same box?
Thanks for reporting the outdated code in the ProFormApiSample. We have already brought the code up to date for the upcoming release.
I'll ask around some other devs, and hopefully manage to repro your issue. Stay tuned.
Yes, I'm running everything on the same system. Setting it up the webservice under Windows 7 was tricky, and it looks like I still don't have it correct. I"ll let you know if I come up with anything else, or a solution.
Robert