Can rest service return .Net Object - rest

I have a client application developed in java. This application consumes rest web service developed in .Net platform.
Rest web service uses our product API to provide respective functionalities to client application. Rest web service uses API login method to login to product and return API .Net object to client.
Issue is rest web service login in to product but object does not return to client. Can rest service return .Net object ?

It is unlikely that a .NET object can be transferred via the API.
One way to do it is to serialize the object (convert it to JSON), with something like this https://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializer.aspx
using System.Web.Script.Serialization;
var json = new JavaScriptSerializer().Serialize(obj);

Related

Where to get the base URL for rest service?

I'm learning REST connector in data factory , I'm trying to create a linked services with REST, but it needs to provide base URL ,I wonder where I can get this.
We can use many programe languages to build a REST Service. When you have permission to access this api, it will return a json object or json object array.
For example, using Spring to build a RESTful Web Service. In this case, http://localhost:8080/ is your base url. If your domain is localhost, you need to use self-hosted-integration-runtime to connect to your local server.

How can I call the Salesforce API from .NET Core

We are presently calling Salesforce using their SOAP API in our app. It is .NET Framework based (written in C#).
We're trying to move it to .NET Core which does not support System.Web. The Salesforce SOAP client is built in VisualStudio using WSDL and that creates code using System.Web.
Salesforce also has a REST API, but unfortunately it using OAuth for authentication and our system is used by many of our customers on servers that there is no one on it to respond to an OAuth login. So we can't use that.
What's our best option here?

How to make a REST API call from SOAP

I would like to know the best practices of calling a REST API from SOAP.
Requirement:
We have a SOAP-based web service that is already consuming by many applications. we would like to rewrite the SOAP API with Rest(basically a Spring boot application), but we want to call the rest from SOAP to support the existing applications.
The one way I know is we can call the Rest Api from the SOAP server implementation class
EX: Consider EmployeeService;java is a SOAP implementation class
EmployeeService.java
getEmployee(){
Calling new Rest Api
}
Existing app1 ---->SOAP --> REST API
Existing app2 ---->SOAP --> REST API
new app1 --> REST API.
Please let me know is there any best way\alternate way to handle it.
You can use boomerang soap client.
Detail here

Can a SOAP web service be called a web API

Is it possible to call a SOAP web service a web api? or is a web api a synonym for a REST Api only ?
It certainly is a web API, so yes. The term API gets used in a lot of different ways, but using it for a SOAP webservice is not unprecedented: SalesForce used to call their SOAP webservice their 'webservice API' but have since renamed it to 'SOAP API'.

What is the benefit of RESTful Web Service Vs Using Just a simple Servlet?

Regardless of whether I create a RESTful Web service to be consumed by Ajax in my own pages, or by any user, I can provide the same functionality (data) to the application or user using a simple servlet.
I mean the user or application don't see any different between response provided by a simple servlet or respone provided by a RESTful web service. So, I'm guessing that the benefit is on the server side and to the developers. Can someone please tell me what are the benefits of using RESTful web services.
I appreciate any respone
By definition a webservice is intended to be consumed by any client granted access. If the client you are developing is the only application that you will ever need or want to access the resource then there is little benefit to creating a webservice. However, if you want to make the resource available as a service endpoint for more than just this application in a way that is implementation agnostic then a Restful webservice is a great way of doing it.