Upgrading a Web Reference in a VB.Net Class Library Project - vb.net

Our vendor has upgraded their SOAP Offering and we need to reference another WSDL file and change the url for the .asmx file to the newer versions.
What is the best way to do this with minimum breaking of the code?
It was referenced with a namespace as is typical.
Should I delete the existing web reference and add the new one using the same name?
Or should i change the 'web reference url' url to the new one and simply update it?
Any ideas / solutions would be greatly appreciated

Here was my solution:
I changed the 'Web Reference URL' of the folder in Web References to the new WSDL
I then right clicked the folder and clicked 'Update Web Reference'
And it changed all of the files that were expected

Related

bindingRedirect in Asp.net vNext

How can I achieve a binding redirect in asp.net vnext? Before I would have configured the bindingRedirect using xml in the web.config file, but I can find how to to this in the Project.json
https://github.com/aspnet/Home/wiki/Project.json-file
Binding redirects are not needed in ASP.NET 5. The loader in ASP.NET 5 will automatically load the correct DLL based on project references and the available NuGet and project references.
Or, if you have a case that doesn't work, please provide more details.
According to David Fowler from the ASPNET team, binding redirects are gone and not coming back. I created a GitHub issue and he thinks this needs to be done at the Roslyn level (basically, don't output this warning anymore).
https://github.com/aspnet/Home/issues/407

How do I access RouteTable.Routes.MapHttpRoute?

I have a Web Forms app that I created a few months ago and I added a Web API controller. I tried to use the 'automatic' routing that I saw in a presentation recently, but all I got was a 404. Then I tried to add routing for the Web API controller in my Global.asax using MapHttpRoute, as I've seen in several tutorials. However, even after adding Imports System.Web.Http to the file, the project will not recognize RouteTable.Routes.MapHttpRoute() I have tried adding other namespaces and ensuring that I have all the necessary Nuget packages, but I still am unable to set up routing for the Web API controller. Does anyone have a recommendation of where to start?
If anyone has this same issue in C# read on.
I am also using a web forms app and set the routing through the Global.asax file. For me Intellisense was 100% correct and it would not build regardless. To get this to work I had to add the following using directives.
using System.Web.Http;
and
using System.Web.Routing;
Becareful not to use using System.Web.Http.Routing by accident. This wont work.
You should add the reference to System.Web.Http.WebHost assembly and make sure you have
using System.Web.Http;
Why ? MapHttpRoute is defined in two assemblies, in System.Web.Http:
public static System.Web.Http.Routing.IHttpRoute MapHttpRoute(
this System.Web.Http.HttpRouteCollection routes, string name, string routeTemplate)
Member of System.Web.Http.HttpRouteCollectionExtensions
and in System.Web.Http.WebHost
public static Route MapHttpRoute(
this RouteCollection routes, string name, string routeTemplate, object defaults);
First one is an Extension on HttpRouteCollection
Second one is an Extension on RouteCollection
So when you have a webforms app, your Routes are defined in a RouteCollection so you need the WebHost version.
Its because architecture allowing WebApi to be hosted also out of IIS. see Hosting WebApi
I found this thread, which indicates that IntelliSense apparently has a problem with this, but if you type something like the following, it will build and run:
RouteTable.Routes.MapHttpRoute("MyApi", "api/{controller}")
I've just created two new webforms apps (one using .NET 4, the other 4.5), did nothing more than add web api via nuget and it worked.
What version of ASP.NET is your app running in? If you're running ASP.NET WebForms 2.0/3.5 then it's not supported.
Here's a tutorial which demonstrates how to add Web API to your Web Forms app - http://www.asp.net/web-api/overview/creating-web-apis/using-web-api-with-aspnet-web-forms
I have the same case, I solved by creating the api controller, when you add the
api controller VS will load all required refrences.

Web API Routing - Returning 404

I have a Web API project in MVC 4 but cannot find the URL to my web service. Rather than MVC, I am actually just using the C (controller) as I'm not returning a view and my model is located in an external project.
I'm using the default route, which is api/{controller}/{id}. The name of my controller is RESTController (I know, probably wasn't the best name) and is located at ~/Controllers/RESTController.cs
Based on naming convention, it seems that my web service should be located at localhost:port/api/REST but I'm just getting a 404 resource cannot be found error (no XML representation of the object returned or anything). Is this the expected behavior without a view?
The funny thing is that I also have a SOAP API in an external project that is actually just returning the REST API result and it works as it should. Doing unit tests on my methods passes... I just can't access it from a browser. I've tried every url imaginable.
Basically...
Would there a way to debug this? (ie. Turning on ASP.NET directory listing)
Does not having a view effect what is shown in the browser?
Shouldn't the browser return an XML file representing the object?
Am I missing something obvious?
Nevermind, I'm a moron. I found the problem... At some point I accidentally drag and dropped (drug and dropped past tense?) my Global.asax file into my Views folder... therefore my routes were not getting registered.
Working as intended now.

Sharepoint Web template

I have created a web template solution by following Vesa "vesku" Juvonen 's blog(http://blogs.msdn.com/b/vesku/archive/2010/10/14/sharepoint-2010-and-web-templates.aspx).
I have the web template and have created sub sites with it. Now I need to create a web template from this template, which would consist of lists and other items.
The publishing feature does not have the save as template option, So I get into the _layouts/savetmpl.aspx to create one or deactivate the publishing feature to create getthe "save as site template option and create one. It creates but does not work properly.
I access the site by appending the default.aspx to the newly created sites url and it does not have any features as that of root template. Is there any way to create a template from the existing web template to work correctly. I am a newbie to sharepoint and vesku's blog has been my reference.
Any options or views to do it correctly would be helpful.
I have thought about creating a site through code and given the user an option to do so by including a web part where he could click on say "create a webs site with XXX template and include XXX lists, web parts etc. Is it a good approach?
If the web site that you created a template for contains web parts that access the GAC (i.e. have DLL's), then you must take the wsp that is in the solution gallery and deploy it as a farm solution.
Templates saved via /_layouts/savetmpl.aspx cannot access the GAC.
if you made a webtemplate why would you want to use the save as site template option? Users can also create sites from your webtemplate and if you need a different template you just add another webtemplate.
The whole principal of web templates is meant to be used for site creation....

Custom webpart issue in sharepoint 2010 site

After configuring the alternet access mapping custom web part is not displaying in the site, while clicking link for webpart
throwing exception:
The "webpart5" Webpart appears to be causing a problem. Exception has been thrown by the target of an invocation.
Web Parts Maintenance Page: If you have permission, you can use this page temprarily close Web parts or remove
personal settings. For more information, contact your site administrator.
Pls help somebody how to solve this issue.
It obviously is the problem with AAM setting. Check how are you accessing the site in web Part. Is it using SPContext ? Or you are instantiating the new SPWeb object. If you are instantiang the new object, check which zone you are referring to.
Post the web part code if possible.