Changing URL for JSON calls to ASMX web service - url

We are making calls from our web app to a 'local' ASMX web service via JSON. I.e. the service is located in the same application.
The URL is configurable. When we change the URL, the call to the JSON service no longer works. We can see via fiddler that the URL is being called and appears correct.
We can also retrieve the WSDL via the new URL.
Are there any settings hard wired into an ASMX service that we might have missed?

Related

Can a web api sit on remote server?

or must it be on the same server as the app calling it? I am new to web api so i am going through some tutorials, but they all assume the web api is part of the mvc app. Also, they show the calls to the api being done with javascript, but I want to make the calls in my MVC app controller. Is this possible?
You can host a Web API anywhere.
The only special thing to have into account when the Web API isn't in the same server that a web site that uses it, is that, by default, the Web API doesn't accept requests from a different domain. For example, if the web site is in "server1.com" and the Web API in "server2.com", then the calls to the Web API from the web server will be rejected.
If this is the case, you need to configure the Web API server to enable CORS (cross origin resource sharing), so that it accepts requests from a different domain. If you want more info about this, please look at this document:
Enabling Cross-Origin Requests in ASP.NET Web API 2
The Web Api can live wherever you want it to. Is typical to see a limited API used mostly to handle AJAX for the MVC application live with the MVC application, mostly because it makes it simpler to construct URLs to the endpoints. If you host the Web Api externally, then you'll have to hardcode the API endpoint URLs, as there's no way to use something like Url.Action to generate them automatically, any more. Regardless, it's a perfectly acceptable way to handle things.
You will probably at least want to add the base URL for the Web Api as an app setting in your Web.config, though. That way, you don't end up with hardcoded references to a particular domain strewn all about your app. That makes moving your Web Api to a different domain much easier, especially when talking about going from development to production.
It is also entirely possible to use a Web Api within your actual controller actions. You'll just need to use something like HttpClient to connect to it and issue requests.

API Manager 1.7.0: disable WSDL from being loaded into registry

When you register a service in the WSO2 API Manager via the Web or through REST interface, you can add a WSDL to your service description. This WSDL is interpeted and loaded into the WSO2 API Manager registry. Is it possible to disable this? Only register the WSDL URL itself.
In our case we have the WSDL and XSD stored somewhere else. We do not want the API manager stores this defintion again in his own registry.
The purpose to store WSDL is, if we store only the actual wsdl url and if we display that in store, user can directly invoke the backend service.(not via gateway)So, user will not use throttling there.
What we do is, when we store wsdl in APIManager, we change the service URLs in the original wsdl to point the gateway URL. So, when user creates request from the WSDL , always he will see the gateway URL only.

consume secure web service asmx in asp.net mvc

I want to consume secured web service in asp.net mvc, I need to create proxy class to this service
I tried to use wsdl.exe tool but it gave me the following errors
There was an error downloading
The request failed with HTTP status 401: Unauthorized.
is there another way to create proxy class
or there is another technique to call this secured web service in my application
It looks like the WSDL requires authentication in order to be downloaded. I suppose the Web Service also. The WSDL.exe utility allows you to specify the username and password to be used when downloading the WSDL. So go ahead, talk to the author of the web service to understand what account you need to use in order to access it and then try the /username and /password parameters:
wsdl.exe /username:john /password:secret http://example.com/foo.asmx?WSDL

WSDL and WEB Service

I am new to web services even after watching a lot of videos and reading a large number of tutorials on WSDL I am unable to understand how to get URL for a method of web service from WSDL. the WSDL file I am provided with is this http://cons.epackagepro.com/m/Service.svc?wsdl I want to call a login method of this web service. Can somebody explain that how to extract exact url for a web service/web service method from a WSDL file and how to pass parameters to a web service (in this particular case I want to call login). All the tutorials I watched tells that service tag of WSDL file has an address tag which tells about the url of the service but this WSDL does not contains one.
One last thing, can I call this service with soap, even soap is not used in binding. And what if I want to call it using HTTP GET / HTTP POST method, how parameters will be provided.
My main concern is how to get url of a web service / web service method from WSDL? The platform for which I want to use it is IOS.
Thanks in advance.

why asp.net MVC controllers are not considered as RESTful web service

I have an asp.net web application, now let say a user send a POST action method to the application using following URL Myapplication.com/Customer/Edit/120, then this URL will update the customer who have ID=120 with the data sent.
So this is the same as calling a web service, since you are integrating with the application (in this case Update a customer) using URLs, so why this is not consider as having a RESTfull web service!
What exactly is a web service ? And how do you differentiate between a web page and web service.
These are just different terms of retrieving some Resource. Either with Web Service or Web Page, you are just requesting for a resource. The representation is fixed for web page i.e its always HTML. If from my web service instead of returning Json or XML , if it start serving HTML would then make it a web page ?
I think the whole concept of web service came with SOAP world. With Rest there is nothing as web service or web page. There are mere different representation for a resource(json, xml, html, image).
Further to answer your
so why this is not consider as having a RESTfull web service!
Microsoft has launched Asp.Net Web API, which is nothing but pure MVC to serve content.

Resources