I do have a working API on one of my servers, lets call him server_one.
So if my HTTP POST is something like https://server_one/api/xyz is there any chance i can configure an IIS to create another call-point like https://server_two/api/abc which acts like an own API but just passes through the inital call and its answer?
Thanks alot in advance!
Related
I've been given a WDSL file and have to create a web service client using axis2. I've been able to generate the CallbackHandler and Stub using WSDL2java. I've tried following this tutorial to create the Client http://briansjavablog.blogspot.com.au/2013/01/axis2-web-service-client-tutorial.html
I'm not sure if I implemented the client properly. It runs, but I'm not sure how you view any output results. I've never dealt with web services before. The Stub file that was generated contains so much code, how am I supposed to know what I should be calling? All tutorials I've found give example Clients, but I want to know what I need to look at to create my own.
If anyone has any advice or links to creating clients that are easy to understand, it would be appreciated.
I think that this probably went un-answered for a while due to the fact that the question is not clear and you probably need an introduction to Web Services and SOAP in general. If you are given the WSDL (or can pull it from a URL out there somewhere) then you are using the Web Service as a client - you have (from the post) already created the stub for client use. You simply need to use it. You are sending a request to the server (Web Service) and sending it the data that it requires (as the SOAP parameters that are laid out in the Web Service schema). Based on this SOAP request you will get a response. Your stubs that are created for the client act as the invocation and response points for your client.
So your question as to how do you test it: you decide what to do with the response as this is what you are coding into the client.
And about creating your own Web Service - you would need to start with a schema (often times you write your objects/data and the functions that you want them to perform and tools (like Axis2) will generate the server code (for Web Services and SOAP transport) on top of this.
So in your question, I think that you need to a) check out some Web Services books/online tutorials to figure out what it is, b) code your client to display the results and stuff - and just make sure that you are actually sending and getting responses from the Web Service, and c) also see what it would take to create your own Web Service (for whatever purpose you are planning the service to be established for, before creating your own.
Effectively I think that you just need to get your feet wet with Web Services in the first place. And the tutorial that you pointed out ( http://briansjavablog.blogspot.com.au/2013/01/axis2-web-service-client-tutorial.html) is excellent for anyone looking to get a web services client started - thanks for posting that.
I have a simple scenario where i want to output only json to the user.Now should i use a simple httphandler, call it from jquery and get the json or create a WCf service?
I want to use WCf service but don't see any advantage, maybe someone can point few of them and scenarios.
Anything would be suffice. Your thoughts are in correct direction, why to create a wcf service and increase the overload(maintaince, deployment etc).
If you are using Ajax, Look in to PageMethods, which would even free you from creating a separate HTTPHandler and you could call your code behind methods directly in your javascript.
I am assuming you are using asp.net.
I have a WCF web service, and a windows phone application.
The phone app's home page has a WCF ("GET") call I would like to refresh every 30 seconds.
No matter what happens to the data on the back end... the call to the WCF service will always return the data from the original call to the WCF service.
If i go to another page, and make the same call I will get the different modified data.
Is there some kind of caching on "GET" calls on the phone side?
Debugger
I do not think it is even going to the WCF to make the call.
My debugger looks like it's not even hitting the WCF again when I try to refresh. The HTTPWebRequest just spits out the oroginal GET call if i am on that same page.
Details
WCF - webHTTPBinding (REST)
I found the answer...
There must be some Magic Caching on windows phone going.
I recall reading on some other thread a while back and tried it.... and it worked !!
Basically i'm just adding a unique id that doesn't matter to he URI string. In the case below.. i decided to use a GUID... this way each call uses a unique different URI for the REST call. It seems to work.
string uri = RESTCon.BaseString + "RESTMethodCallName?id={0}";
w.DownloadStringAsync(new Uri(String.Format(this.uri, Guid.NewGuid().ToString())));
I'm fighting since two days with a simple question : Is there a way to identify the source of a WCF call ?
I'm trying to find a realiable .Net property that will let the service know the address (URI) of the calling Web Service.
Especially in the case where two Web Services are hosted on the same machine.
Thanks in advance.
What about the calling client do you want to detect??
In .NET 3.5, you can fairly easily find the client's IP address - see Keyvan's blog post on that topic.
Is that what you're looking for?? If not, you'd probably have to add the caller information to the message (or the headers) explicitly for the server to be able to inspect that information.
Inside a WCF service, can I find out which URI was used to call me?
Well, you can e.g. look at:
string localAddress = OperationContext.Current.Channel.LocalAddress
Is that what you're looking for?
Basically, on the server side, you'll probably only be able to determine which of the server's endpoints was hit - you most likely won't be able to really find out what the caller on the client used as a URL (just a hunch).
Marc
There is other thread that might answer your question.
The OperationContext.Current.Channel.LocalAddress will not work in a service that is hosted in IIS which have multi websites. Using OperationContext.Current.IncomingMessageHeaders.To is more logical.