Hi,
Please bear with me while I paint the full picture so that any kind soul could kindly give me some pointers... All of the codes are running on my development environment. The following is the services that I have.
- WSS 3.0 setup locally, I have my list all populated with data.
- Web Service that is developed and deployed locally (http://localhost:12345)
- Console Application that is deployed to a folder in the local drive.
Scenarios
- The console application will fetch information from the database.
- Loop through the records row by row.
- Call the Web Service that is developed to poll SharePoint List for the list item.
- Once the item is found, modify the content of the list item and update it to the list.
Problems
- When I run the application, I got the following error message.
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.IO.FileNotFoundException: The Web application at http://127.0.0.1:33678/SharePointWebServicesHelper.asmx could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application. at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, SPUserToken userToken) at Microsoft.SharePoint.SPSite..ctor(String requestUrl) at SharePointWebServices.SharepointWebServiceHelper.UpdatePCInventoryCIStatus(String site, String _sccmHardwareID, String _sccmComputerName, String _sccmUserName, String _sccmAgentTime, Int32 _sccmStatus) in SharePointWebServices\SharePointWebServicesHelper.asmx.cs:line 88
Settings
Have google and found some other leaks...
- Ensure that the application (Console Application & Web Service) is compiled in x64 CPU Type.
- Ensure that the Identity to run the SharePoint site and the web service is both the same user.
- Ensure that the user stated above has the rights to access the SharePoint database.
Other Details
- The WSS 3.0 installation is powered by the embedded database. Which is using the following connection host: \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query
Source Codes - Web Service
[WebMethod] public void UpdatePCInventoryCIStatus(string site, string _sccmHardwareID, string _sccmComputerName, string _sccmUserName, string _sccmAgentTime, int _sccmStatus) { SPList tSPList = null; using (SPSite oSPSite = new SPSite(site)) { using (SPWeb oSPWeb = oSPSite.OpenWeb()) { tSPList = oSPWeb.Lists["PC Inventory"]; //tSPList = oSPWeb.GetList(""); SPListItemCollection items = tSPList.GetItems(new SPQuery() { Query = @"<Query><Where><And><Eq><FieldRef Name='Computer_x0020_Name' /><Value Type='Note'>" + _sccmComputerName + "</Value></Eq><Eq><FieldRef Name='Hardware_x0020_Id' /><Value Type='Text'>" + _sccmHardwareID + "</Value></Eq></And></Where></Query>" }); foreach (SPListItem item in items) { item["LastLogonBy"] = _sccmUserName; item["AgentTime"] = _sccmAgentTime; if (_sccmStatus == 0) { item["StateField"] = "Inactive"; } else { item["StateField"] = "Active"; } item.Update(); } oSPWeb.Close(); } oSPSite.Close(); } }Source Codes - Console Application (One method)
private static Boolean updatePCInventoryItem(string _sccmHardwareID, string _sccmComputerName, string _sccmUserName, string _sccmAgentTime, int _sccmStatus) { SharePointWebServicesHelper.SharepointWebServiceHelperSoapClient webService = new xxx.SyncStateField.SharePointWebServicesHelper.SharepointWebServiceHelperSoapClient(); string spWebServicesUrl = ConfigurationSettings.AppSettings["SharePointWebServices"]; try { webService.UpdatePCInventoryCIStatus(spWebServicesUrl, _sccmHardwareID, _sccmComputerName, _sccmUserName, _sccmAgentTime, _sccmStatus); } catch (Exception ex) { WriteToLog("Exception: Error updating PC Inventory item through web service."); WriteToLog("Exception Message: " + ex.Message); return false; } return true; }
Can get any advice on this on where that I have done wrongly?
Cheers!
Regards, Milton Goh "NERDY" Technology Evangelist NerdyTWO - You reap what you sowed.