Monodevelop - Update the URL of a web reference - wcf

I have a monotouch application which accesses a WCF web service. This application is built within Monodevelop.
I have recently released a new version of this webservice. I.e. from http://localhost/v1/webservice.asmx to http://localhost/v2/webservice.asmx.
I need to update the url of web service in my Monotouch app and update the reference so that I can access the new methods. There does not seem to be a way to do this via monotouch. What is the simplest way to accomplish this task short of deleting and re-adding the reference?

That does not seem possible via the GUI indeed.
It seems that the URL is stored in Reference.svcmap.
You could try editing this file, then running Update Web References. I have not tried though.

Related

How to add WCF Service to .NET Core project in Visual Studio 2019?

I am unable to add a connected service reference to a WCF endpoint in VS 2019. I used to be able to do it in VS2017 with an extension. Now I can't find the extension anywhere, and when I try to add a connected service, I get lots of options but nothing for a WCF service.
Just to clarify, I am not trying to develop a WCF service, just trying to create a service reference to act as a client to a remote WCF service.
There is an article on how to use such a tool, here, but absolutely no information on where to find the tool or how to install it. I even found what may be the source code for the tool, but again with no installation instructions.
My project is a .NET Core project, targeting NetStandard 1.6.
.Net Core is still supporting client-side. You can use hosted service in it and add the ip:port/wcfinterface from the connected services.
You can try it by following this link.
I was able to resolve this issue by simply creating a new class library targeting NetStandard2.0. Right-clicking on Dependencies -> Managed Connected Services now showed an additional item below the Service Dependencies item, called Service References. Adding a new Service Reference, you are then presented with a WCF option.
I tried re-targeting this class lib back to NetStandard1.6, and all is still working. My original class lib was very old, and had some old stuff like dnxcore50 in the .csproj file, so maybe something there was screwing it up.
Thanks all for the suggestions.

WCF, DLLIMPORT strange issues

I have a very strange issue that i cannot figure out.
First i have a WCF service 4.0 done in VS2010.
the service have couple methods that return string array, datatable and such.
some of them use function from C++ dll throught [dllimport]
i made a test console to test everything. when i run the WCF from visual studio and use the generated path it works wonderfully.
now here is where it become strange. if i open my local IIS create a new application and point to my VS source code the WCF i can see it perfectly.
now using the http path from IIS local instead i refresh the methods all seems correct. But when i run my test app i can call any unction without any problem EXCEPT anyone using DLLIMPORT functions. they ALL crash and cannot trace even by tracing CES exceptions.
Doing line by line logging show that the exception is really on the call of those functions
the DLL in question is the same and the path is hardcoded for my computer since still in test phase and the folder is c:\DLL\mylib.DLL so nothing to do with shadow copy IIS/visual studio do when you actually run. also DLL reference by name withotu path even if it's in sys32 doesnt work.
Any clue ?
also. 32bit, changing app pool level right access on folder, full admin on machine already too. all tried but unsuccessful.
Edit: adding to all that since i haven't made this clear, it's not my first WCF real setup. i've already made alot of services before and deployed them myself (probably somewhere around 50-60 services). I am asking because i have never seen this issue before and i tried all tricks i knew and could find on the internet and resource people i know.
We have decided to incorporate the whole service in the WPF project locally since it work as long as IIS is not hosting. but this is really not a good thing as this data and work should NOT be done on client side but instead on server side. Right now it's fine since the software that need to use this is not released to public yet so it isn't critical.
Next option will be net TCP/IP windows service hosted on the web server if i don't find anything else.
We decided to go trough the trouble of having to hard code the logic in the main software and get away from web services for this issue. we will have to deal with updating, installing unregister and re register unmanaged DLL by hand somehow but at least it works.
we have added over 5 web services since that happen and no problem with them but again none of them use DLL imports.

Help with silverlight

I have some methods which are not compiled with Silverlight framework but are very essential for execution of SL workflow(by workflow, I mean to process my application completely). What is the best/quickest way to do so?
I was thinking of publishing a web-service(for non-sl compiled methods) and make SL call into my WS.. but I am unable to see/create webservice instance even after registering one in my SL project. (I am using VS 2010)
any help?
Esentially, you have three ways to run code.
native built-in methods in your application--this would be the easiest way
methods that live in an external silverlight assembly, like a class library
use a webservice
if you use a webservice, you have to either host the website yourself or use a 3rd party website, then add a reference to said service. if the service is not hosted on the same website as your silverlight app, there must be a cross-domain policy file in place otherwise silverlight will not use the service.
if you use an external assembly, it MUST be a silverlight assembly. you can not use a windows class library, etc.
There is a common (and relatively easy) way to solve this issue without requiring a web service: you can create a new Silverlight class library and then share the files from the other project through to your new Silverlight library.
To do this, right click on the library in the Solution Explorer, and select Add -> Existing Item, then navigate to the appropriate code file, select it, but instead of just clicking Add you should instead click the little down arrow and select Add As Link.
Of course when you do this you have to ensure that the shared files don't contain anything that cannot be compiled targeting the Silverlight runtime, if they do then you will either have to use conditional compilation directives to isolate out that code, or revert to the web service option.

Monotouch Web Reference Namespace Issue

I have an ASP.net web service sitting on a server, and I have verified that it works properly via a small test client app in VS.
I went to add it in MonoDevelop to my MT application, (Trying both the ASP.net 2.0 and WCF declarations). Inside the "Add Web Reference" wizard, it finds the web service fine. But when I go to reference it, the app doesn't know it exists.
I went to look at it, and it seems when adding it, the namespace it's assigning to it is the title of my solution (which has spaces in it), but the namespace for each of my .cs files within my app contains no spaces.
Web Service Namespace (that it wont let me change): Ultimate GameDay 2011
MT Application Namespace: UltimateGameday2011.
So I manually went into the reference.cs file and took out the spaces. The app classes then saw my web reference object, but it still won't allow me to access any of its members.
Any help would be greatly appreciated.
Check out the following link http://merbla.blogspot.com/2011/03/monotouch-with-json-using-aspnet-mvc.html
Its not a fix to your problem rather a method of creating web services that MonoTouch more easily works with. In my experience ASMX and WCF services have been problematic when consuming in a Monotouch app.
If all else fails, try using the Silverlight service utility located in your programs folder
e.g. C:\Program Files (x86)\Microsoft SDKs\Silverlight\v4.0\Tools\SlSvcUtil.exe

Silverlight WebRequest/WebClient SecurityException issues with local file system

I've stumbled across a few sources that state that silverlight cannot execute web requests when running from a local file, ie. using file:// instead of http://.
The problem I have is that we're using a sidebar gadget to host our silverlight app. Previously we were using WCF but now, when trying to include a RESTful json service, we can't due to this restriction.
Is there any workaround for the limitation of not being able to execute web requests when executing silverlight from the filesystem?
Edit - Update
I've stumbled across the term Cross-scheme to describe this sort of request, but it doesn't seem like it used to be supported, not sure about Silverlight 4.0. This is catastrophic for us. Any help or workarounds?