How can I discover what JSON endpoints a WCF service has? - json

How can I discover what JSON endpoints a WCF service has?
I know I can append wsdl to the URL and get the SOAP call details ...
http://myserver/Explore/TestService.svc?wsdl
but how can I get what JSON calls the service has?

You can't - there is no built-in mechanism for rest endpoint metadata - you just need to know which http options are applicable to which resources. You'll also need to have some types ready to deserialise to - if you can't get this information off the service provider then you'll need to infer them from the response json.
There is a service discovery standard called WADL which is supposed to do for http what wsdl does for SOAP. However unless the service provider has published one you're out of luck.

Related

Should I send new or old Context object to 3rd party gRPC API within my own gRPC server?

We have a gRPC server written in golang. For one of the RPCs, we request data from the Google Maps gRPC API. Once we receive a response from the Google Maps RPC, we do some calculations and return a response to the enclosing RPC (defined by our server).
Naturally, we receive a Context object when the RPC is called on our server.
My question is: Should we pass this same Context object to the Google Maps RPC? Or, should we instead create a new Context object (using context.Background()), and then pass this to the Google Maps API?
The context you received contains the cancellation and timeout, so it would be good to use the same context to make the new RPC. Otherwise you need to manually pass these signals.
A side on the metadata, metadata in the received context will not be automatically forwarded to the new RPC, see:
https://github.com/grpc/grpc-go/issues/1148
https://github.com/grpc/grpc-go/pull/1157
As far as i have figured, 1 context is valid for the life cycle of 1 and only 1 rpc.
So as soon as we realize that we are about to make a whole different rpc call, we should make a new context.
However, The metadata of the new context may be inspired by the metadata of the current context.
An RPC here may be considered analogous to a single activity/service/broadcast in android.

What are data formatters and http protocols? When we should use them?

What are the data formatters and http protocols?
I am somewhat confused about the below terms:
1.ODATA
2.REST and SOAP
3.WCF services
4.XML web services
5. JSON
6. WSDL
REST - A style of web services.
JSON - JavaScript Object Notation - basically, a concise way of serializing objects.
SOAP - An XML format used to do web service calls
WCF Services - a Microsoft framework for making web services.
WSDL - Web Service Description Language. Usually used to automatically discover information about a web service, generate proxies, etc. - typically used with SOAP-based services.
OData - standard protocol/format for calling RESTful web services
The HTTP Protocol is at a somewhat lower level than these protocols are - it's a general application-level protocol that's used for making requests and responses in general. It's more about how you do a request to a server (and what it'll send back) in general, whereas things like OData and SOAP dictate what you actually put in the request and response. Does that make sense?

Is there a tool that can generate call to rest web service

I have a URL to rest web service (made in WCF with JSON endpoint) that I call by passing JSON with all parameters.
But I don't know some parameters names.
Is there some tool where I can enter service URL and method name to get JSON example that I must pass to this method?
I know that tools like this exist for SOAP services but I need for REST.
I just tried to use wcf test client but I can't load the JSON endpoint it's only for SOAP.
...svc/json
There are various addons for rest and soap services. you can try as per your requirement.

Sending JSON formatted data to a SOAP endpoint (WSDL)

Is it possible to send an API call in the format of "application/json" to a SOAP endpoint?
When working with JSON, I know we typically work with REST services. But due to limitations on the customer's side, they cannot send a typical SOAP envelope (XML, name/value pairs), instead, they can only send JSON data to a WSDL service.
I do not know of the customer's development environment yet (I have an email out to them) which this API call is being made from.

JSON, AJAX, REST Terminology

Currently writing some documentation. Just wondering if we are using the terminology correctly.
We have an AJAX script that calls a service using a HTTP GET that returns JSON.
Would you call the service a REST service or a JSON service?
Using HTTP does not mean you're automatically following the REST architectural style. If you don't know what REST is, you're pretty much guaranteed to not be doing it. Call it "a web service that returns JSON" instead.
I'd call it a REST service which returns JSON.
EDIT
6 years on and what was I thinking! It's a web service which returns Json, as suggested in other answers. It may be RESTful, it may not.
A client calling a service using an HTTP GET would not constitute a RESTful architecture. The following elements should exist for a service that has a RESTful architecture.
HTTP - used as an application protocol, not a transport protocol
URI tunneling
Hypermedia
So, in your scenario, based on the given information, your service can be classified as a regular service with JSON hypermedia or content type. It is definetly not a REST architecture.
Here are some additional information:http://goo.gl/32gLK