ASMX + external dll - web-services

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?

Related

How to unit test UWP App with Azure Mobile App?

Consider a Visual Studio 2017 solution with 3 projects:
UWPApp - Universal Windows App
UWPAppTest - Universal Windows App Test (NuGet package: Microsoft.Azure.Mobile.Client)
MobileApp - Azure Mobile App web service (NuGet package: Microsoft.Azure.Mobile.Server)
I'd like to create a unit test in my UWPAppTest project, that calls my web service, running locally in my MobleApp web service project.
This requires me to somehow configure Visual Studio to launch the MobileApp project (selecting "don't open a page"). And at the same time, click "Debug Selected Test" in my test explorer. Or, somehow automatically launch the MobileApp in debug mode, when I debug a unit test.
This doesn't look like a supported scenario, and if not, what would be the next best workaround to be able to run a UWP test project, with tests calling a local web service?
Thanks
-John
This is something that Azure Mobile Apps has had to deal with as well. We use end-to-end test scenarios with a mobile backend hosted in the cloud. The test run will clear the contents of the database prior to each run, thus ensuring the appropriate unit testing. The biggest thing here is dealing with state.
In a local debug version, you will want to set the URI passed into the MobileServicesClient to your localhost, but things should not be any different. Just ensure you are fixing the starting point and ending point of your database for each test.

Hosting web service on IIS 7.5 which consumes 64 bit third party DLL throws error Could not load file or assembly or one of its dependencies

we are working on windows 2008 R2.
we have a web service(frame work 4.0) which consumes 64 bit third party DLL. when we run web service from VS 2013 or from IIS 7.5 we got a error saying “Could not load file or assembly or one of its dependencies. An attempt was made to load a program with an incorrect format.”
with the help of stackoverflow we have set the below option in VS 2013
Tools | Options | Projects and Solutions | Web Projects | Use the 64
bit version of IIS Express
and published the same from VS 2013 on IIS 7.5 and it is working :)
now we have published same web service on different machine where Visual studio 2013 is not there and we are getting the same problem again.
“Could not load file or assembly or one of its dependencies. An
attempt was made to load a program with an incorrect format.”
how to make this web service working?
After doing lot of googling i have come across this link debugging-assembly-loading-failures
so with ref to above link if i have fuslogvw.exe, it's easy to find where the problem is.
So to get fuslogvw.exe i have installed SDK for .net framework
Now i got fuslogvw.exe and i configured it as mentioned in debugging-assembly-loading-failures and i browse my web service from IIS Manager and i am expecting errors so i am checking Fusion log and i found no errors there. Confused!!!
now i came back to browser and i found my web service is working :)
So installing SDK fixed the problem.

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.

Pocket PC 2003 application with webservice

I am working on a Pocket PC 2003 application that is referencing a Webservice.
I was figuring out ways to debug the Webmethods but not successful.
-I checked the URL property of the Service in WebReferences and made sure it is correct.
-I started debugging the PocketPC application, then built the Webservice as start without debugging, after that went to Debuh> Attach process and attached devenv-"Pocket PC app"
-I also tried attaching to the aspwp.exe process but couldn't seem to hit the break points in Web Methods.
-The webservice is deployed to IIS virtual directory.
-I copy pasted the entire webservice folder in the virtual directory. Then I am opening the solution file in Visual Studio. Start without debugging, when the webmethods show in browser, click on it, then click Invoke
Can someone guide me the proper way to debug a Webservice of this type? Thanks in advance.
If you're using Visual Studio 2005 or higher, instead of IIS, use the toy Web service that comes with Visual Studio. In the properties of your ASP.NET project with the Web services, under "Web", check the "Use Visual Stuidio Development server". In order to make the toy server start, you have so start the ASP.NET project from Visual Studio.
Then you attach to the process called Webdev.Webserver.exe using Managed code debugging.

Web service on iis not updated

I deployed a web service to iis 7, it was working all the way right.
Then I wanted to update the code of a web method in the web service.
I recompiled the service and updated the dll in the iis directory with the new one.
My problem is when I invoke the service, it invokes the older code.
I tried changing the number of parameters passed to a web method inside the service, and when invoking it still sees the older parameters which I erased.
Web services after Framework 2.0, are compiled as DLL files by default as far as I know. Normally, this happens when you PUBLISH the website and webservice, or when you use Web Applications.. But in WebServices, Visual Studio compiles the output as DLL. Therefore, you should compile your dll and update on the IIS. Even though you see the CS code files on IIS folder, they are not being used. Only the asmx file (not asmx.cs) are used to map the code in the dll.
I am guessing that the old code is cached. Try restarting IIS. That should cleanup any remnants of the old code.
It seems that you need to update your service reference.
Go to the project who's using the service, left-click the service reference in your solution explorer and finally choose "Update Service Reference".
Maybe I'm wrong and you did it, but as you don't mention that in your question, this is my suggestion.
rebuild the solution, And deploy the service on IIS. It will work definitily