Accessing Internal Custom WebServices of Sharepoint - web-services

I'm a new to sharepoint and IIS. recently, I've got a SP solution bundle which has got a web service located in Layouts folder. I managed to successfully deploy the solution.
The problem is I'm not able to access the webservice in solution, as I guess I might missing some stages in deployment.
I deployed the Solution directly from visual studio to my desired web application on sharepoint server. The service file has already been placed at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\template\layouts\MyFolder\ServiceName.asmx
However, once I try to call it cannot being accessed via application url:
http://localhost:9999/_layouts/MyFolder/ServiceName.asmx
Do I need to set anything in order to be able to access the service via desired url?

I just got it. I did deploy Bundle on Sharepoint 2013 and I just realized it goes under _layout/15/MyFolder!
I have fixed my problem anyway

Related

VS 2019 - core 5.0 - Error adding WCF Web Service reference

I'm trying to add a reference to web service in VS 2019.
I think the installation might be damaged?
After I right click on the Connected Services node in the Solution Explorer and choose Add Connected Service... then I pick Microsoft WCF Service Reference Provider...
Then I paste my URI for the wsdl into the URL input field.. and click go..
The following is displayed...
Resolving project references ...
Importing web service metadata ...
Number of service endpoints found: 1
Scaffolding service reference code ...
Error:Unable to find deps.json generator project.
Am I right in thinking this deps.json is something that is missing in the install and would necessitate a repair ??
Thanks
Yep, checked this against another installation of visual studio and there was a missing folder.
C:\Program Files\dotnet\sdk\5.0.203\Sdks\Microsoft.NET.Sdk\targets\GenerateDeps
So, copied that folder and contents over and all ok...

Visual studio 2017 Publish web project to folder fails

The following errors pop in the log when publishing web project to folder.
....
Publishing folder /...
Publishing folder bin...
Publishing folder bin/es...
Publishing folder bin/roslyn...
Unable to add 'bin/roslyn/System.IO.FileSystem.dll' to the Web site. Unable to add file 'bin\roslyn\System.IO.FileSystem.dll'. The process cannot access the file because it is being used by another process.
Unable to add 'bin/roslyn/System.IO.FileSystem.Primitives.dll' to the Web site. Unable to add file 'bin\roslyn\System.IO.FileSystem.Primitives.dll'. The process cannot access the file because it is being used by another process.
Unable to add 'bin/roslyn/System.Reflection.Metadata.dll' to the Web site. Unable to add file 'bin\roslyn\System.Reflection.Metadata.dll'. The process cannot access the file because it is being used by another process.
Unable to add 'bin/roslyn/System.Security.Cryptography.Algorithms.dll' to the Web site. Unable to add file 'bin\roslyn\System.Security.Cryptography.Algorithms.dll'. The process cannot access the file because it is being used by another process.
Unable to add 'bin/roslyn/System.Security.Cryptography.Primitives.dll' to the Web site. Unable to add file 'bin\roslyn\System.Security.Cryptography.Primitives.dll'. The process cannot access the file because it is being used by another process.
Unable to add 'bin/roslyn/System.ValueTuple.dll' to the Web site. Unable to add file 'bin\roslyn\System.ValueTuple.dll'. The process cannot access the file because it is being used by another process.
Unable to add 'bin/roslyn/VBCSCompiler.exe' to the Web site. Unable to add file 'bin\roslyn\VBCSCompiler.exe'. The process cannot access the file because it is being used by another process.
Publishing folder bin/zh...
...
Publishing folder Views/WFDefs...
Publish failed. Target file://machine/d$/PATH.
If i publish using web publish it works, but the real target doesn't support web publishing.
Note: VBCSCompiler is not running.
I had the same problem with my application with Visual Studio community 2017. In my case the solution was simple, I only deleted all the files inside the directory bin (C:\Projects\DotNet\ApplicationName\bin) and after I recompiled the application.
I hope it can help you.
Had this same issue in Visual Studio 2017 Community Edition. As your question came up in Google but no answer, I thought I'd add to it.
I found Process Explorer from Sysinternals helped me a bunch.
Open sysinternals and go to Find -> Find Handle or DLL... or (Ctrl + F) and search the file that's being held open. In my case "System.IO.FileSystem.dll"
The search results showed two instances of MSBuild and one VBCSCompiler was hanging onto the files. Worst case, I just killed the process tree, built the project and all was well again.
Related answer: https://serverfault.com/questions/1966/how-do-you-find-what-process-is-holding-a-file-open-in-windows
If you try to publish asp.net web app in Azure and getting above error then try to UPDATE the Microsoft.CodeDom.Providers.DotNetCompilerPlatform package to V1.0.7 or later. Initially, in your application, there will be Microsoft.CodeDom.Providers.DotNetCompilerPlatform version 1.0.5 then uninstall and then install the latest version V 1.0.7 or later of it. Clean your solution and build. Now you will be able to publish your web app in Azure using Visual Studio 2017.

ASP.NET Web Service returning Bad Request in Windows Azure

After a Windows 7 fresh restart, I open the Visual Studio 2010 as administrator, create a new project of Windows Azure Project with ASP.NET Web Role, then at the WebRole1 project I add a WebService1.asmx and press F5 (run).
The Windows Azure services starts OK and the browser open the http:/127.0.0.1:8080/WebService1.asmx perfectly. But when I click at Invoke button to test the webservice method I always receive a Bad Request - Invalid Hostname, with a http:/127.0.0.1:8081/WebService1.asmx/HelloWorld.
The most likely cause is ASMX's WSDL file doesn't stand by load balanced environment such as Windows Azure. The test feature relies on WSDL. You will see similar issues if you add a web/service reference. It is recommended to upgrade to WCF. In WCF, you can use useRequestHeadersForMetadataAddress (http://msdn.microsoft.com/en-us/library/ee816894.aspx) to fix the issue. If you need to use ASMX, please try to manually provide a correct WSDL file.

How to publish a Web Service from Visual Studio into IIS?

I have written a WCF web service in C#. I had originally self-hosted it and then decided to host it on IIS running locally on my PC. While the service is working, there are several aspects of the deployment process that I don't understand:
Firstly, the URL of this service when hosted in IIS does not correspond to what I specified in my web.config. I had specified "http://localhost:8000/MyServices/OrderService" there and this was used when I self-hosted. Now that I've deployed to IIS, the URL has become "http://localhost/MyServices/OrderService". Why is the URL not picked up from my config file?
Secondly, to host the Web Service, I created a new web site within IIS (in addition to the existing 'Default Web Site'). I set the physical path to c:\inetpub\wwwroot (no idea if this is correct) and left the other parameters as default. I then copied my /bin folder, my .svc file and my web.config to this folder. Is this the equivalent of a 'Virtual Directory'?
Finally, the service didn't work until (within IIS) I selected 'Convert to application'. Why is it necessary to select 'Convert to application'?
Can anyone explain what the correct procedure is to publish a simple web service from Visual Studio into IIS, or point me at some good documentation so I can understand the process?
****EDIT TO ORIGINAL*****
Having spent more time looking into this, I have found the following:
When I create a web site in IIS, I give it a physical directory of c:\inetpub\wwwroot....etc
If I then "publish" from within Visual studio, all it's doing is copying all the required filed (like the /bin directory, web.config and .svc file) into the physical directory of the website i.e. - c:\inetpub\wwwroot...
You can perform the copy manually to the same affect.
Lastly, with regard to the URL of my service not corresponding to the baseAddress section of my web.config file, this has been answered on stackoverflow previously.
The answer is that the baseAddress is completely ignored when hosting on IIS.
If using Visual Studio 2010 you can right-click on the project for the service, and select properties. Then select the Web tab. Under the Servers section you can configure the URL. There is also a button to create the virtual directory.

ASMX + external dll

I am working on Silverlight client to Microsoft Team Foundation Server. I am using an ASMX web service to make the actual calls using the TFS api.
Everything works fine when I run it with the visual studio development server, but I cannot figure out how to deploy the app to IIS.
I can get the ASMX web service to work unless it is a call that uses the TFS api. I have tried putting all of the TFS api DLLs in like every directory that I can think of, and even installing the visual studio sdk. Nothing works!
UPDATE 11/15/09 7:50PM EST:
Turns out that the TFS api was trying to create a cache at c:\Documents and Settings\Default User\Local Settings\Application Data\Microsoft\Team Foundation\2.0\Cache\, and the IIS_WPG user didn't have access to do so. Easy fix.
The only supported way of installing the TFS API is to install Team Explorer. You could try to GAC just the assemblies you need, but you're on your own [and technically violating the EULA]...
Other things to check:
IIS is running in 32 bit mode
Impersonation is working correctly
Proxy settings
What error do you get? Have you tried attaching a debugger to IIS?