Can I expose or publish a SOAP web service on Heroku? - web-services

We have Salesforce in house and need a proxy server to send API calls to an external Web Service interface (Box). Since Salesforce only allows 10 callouts per apex invocation, we need an external cloud server to send these callouts. Not having the money for CastIron or even Pervasive, I was wondering if we could implement this on Heroku?
Of course, Heroku needs to be able to receive Soap messages and send them.
If it can, this would be all we need for our Box integration. (I think)
Does Heroku have addons that receive Soap Messages?

Yes, Heroku is designed for, among others, use cases like this.
Run and scale any type of app.
Run any web or background process with any web framework or worker
type. Get direct, granular control over your app's workloads. Scale
distributed processes effortlessly with a single command. Easily scale
to millions of users.
Heroku Home Page

Related

How can I invoke a desktop app from Google Cloud Platform services?

I'm building a desktop client app (win/linux/mac) with a backend hosted in GCP (I'm considering other cloud platforms too). The desktop app should be minimalistic and provide access to local machine resources to the backend. And I'm looking for a way to invoke my app from the server (when some event occurs) and then the app would do some work on a local machine. Here's what I've tried so far.
Google Cloud Pub/Sub. Seems like it does what I need, but to make it work I have to create a service account, generate JSON key and store it locally, which is not good. I can restrict the service account access permissions, of course, but still it doesn't look good to me. Maybe there are other ways to auth my app running at the end user machine? I want to keep my desktop app minimal (ideally without UI, just an "agent" console process / Windows service). Maybe I could consider a login screen to connect the app with the backend, if that solves the problem, but I don't want to overcomplicate.
Google Cloud Run + SignalR / WebSockets. This solution also looks good, but it has one significant disadvantage. As long as there's at least one open WebSocket the Cloud Run instance is considered active and therefore billed. There are other difficulties related to scalability and container instances synchronization too.
What do you think about the options above, and what are the other possibilities? Am I left with REST API and polling for updates? I'm quite new to the cloud stuff so any help is appreciated. Thanks!
If you want to be able to invoke your local app from Google Cloud, you need 2 things
The first one, to register your app on Google Cloud, with, preferably, a auth mecanism (can be an API key for example). Like this, the GCP backend know where to call you app (which IP/port) and how (the auth mechanism)
The second is to have your app up and running and listen external communication. HTTP is the easiest way. Wait a HTTP call on the IP/port defined during the registration, check the auth and perform the process.
You can store the data (location and the auth) in firestore for example, and use Cloud Run to perform the HTTP call.
You can also inverse the solution and to poll (long polling or regular poll) the backend from the local app when it is running.
The 2 approach are possible, the second one slightly easier but can be challenging to manage the security.

Can I use AWS Lambda for my requirements?

I recently visited "AWS Free Tier". Under that in "serverless" option is "AWS Lambda". I am trying to develop an application. I want to know what will be the best resource to use.
USAGE: I need to connect to server through mobile app using HTTP POST. 1st it will register the bus number. Then it will add the corresponding bus stops and the fare between each bus stop. The app will next time send bus number and get all bus stops. Then it will select 2 bus stops and send to server. It will pay the required fare. Server will generate the bus ticket and store in database. It will send 1 copy to the mobile.
I need an web server for development and testing purpose. I had started with JSP. But due to some reasons I was not able to access the JSP page through android app. However I was able to access the JSP through browser. In android app, I can access other websites. I think the url was the problem. So, I decided to use AWS server. Please let me know where I can use JSP. If you have any other server and database, please let me know. Currently I will be using it for development and testing purpose. So, 1-5 users may use it. But later I will run it as a business. Then more users will be using it. (So, please let me know about the payments for business use also, if you have idea about that) I will need database also.
You could write a service which recieves an HTTP request and accesses a database as part of the logic it performs to generate a response and host that service with AWS Lambda.
You would need a database in addition to AWS Lambda (there are many database services available from AWS and other providers).
You can't just drop your JSP files onto Lambda. It does not support JSP (although it does support programs written in Java).

Web app using Hyperledger Composer REST Server

I'm building a Web application as an interface for a Business Network. I would like to reuse some of the REST Server functionality (e.g. GitHub login and storing cards in a MongoDB database) but do a few things differently. For example, I want to generate all cards on the server, so that the users won't have to upload them. Plus, I need to serve the static files from somewhere. I'm trying to figure which architecture I should use.
The app would serve 10's - 100's of users, potentially scaling to 100's of 1000's.
So far, I thought about these options:
1. Have a different app on a different port; REST endpoints called from the client.
2. Same, but REST endpoints called from the server (also means that I'll have to forward the login process somehow).
3. Extend the REST server with custom functionality (is it possible?).
4. Don't use the REST server but steal some of its code to use it in my app.
Questions:
Is it possible to extend the REST server with custom routes?
What is the recommended architecture for a Web interface for a Business Network in production?
Yes you can take the REST server and customise, its open source
See https://github.com/hyperledger/composer-knowledge-wiki/blob/latest/knowledge.md#information_source--node-js-application-development-questions-eg-build-real-time-apps-login-etc for some insights, resources and guidance. The business network is essentially a smart contract (including transaction logic, code, queries, access control lists etc etc) deployed to a blockchain runtime (running as native chaincode in Fabric). Your web interface to interact with the ledger (ie through business network cards stored in wallets (whether server based or cloud based ) could be using Angular (app) / Typescript / React JS (for UI elements) but the salient point is that you can interact with the deployed business network card using the Composer APIs, JS and REST. The application users would interact from the app, using their business network cards, which connection info, the user's blockchain identity and some other metadata. See more info here on Composer's architecture.

JMS, Message Queing Service, ESB related question

Assume there are 2 web services A and B setup in SOA infrastructure.
Web services A depends on information that is available from the locally installed Desktop application (its a legacy application based on C++ programming and provides C++ API to give the information needed by web service A).
The scenario is this: Human actor (which can be considered as Consumer of web service B)logs into a website and clicks a button which requests the service provided by web service B. As part of this request, his ID is sent. Web service B sends request to web service A with this ID. Web service A uses this ID to somehow determine a way to talk to locally installed desktop application of the human actor who originated the request.
The main problem how can web service A connect to desktop application and get the information in a reliable way using SOA infrastructure.
Assume that everything in this SOA is Java based except the desktop application.
The desktop application is basically like a CRM application with its own internal database and not traditional database like MySQL. It provides just basic textual information about the human actor and about the customer(s) of that human actor in his installed CRM desktop application.
I do want to use SOA related technologies even though it may be more complicated.
Given above details:
How can I use JMS to solve this problem?
If JMS is not the right solution, what about ESB and how can I use ESB to solve this problem?
The communication with the desktop application will greatly be determined by what different methods the application is capable of performing. If the application has a database backend, an ESB can facilitate communication with predefined adapters for the specific database being used. If the application has an api that can be tapped programmatically, that is a method as well. I am not sure JMS would be the appropriate solution since given your use case you would want a synchronous reply. Putting JMS in the middle (somehow) will break that reply and rather return an asynchronous response.
I would recommend looking more into the functionality available in the desktop application and with your findings start with evaluating ESB functionality. An ESB may be overkill for this use case but if you plan to do more operations like this it may become valuable.
I think the problem boils down to a Java Web Service A, having a requirement to talk to a C++ desktop application to get user details.
If the Desktop application is able to use JMS using Stomp etc, ActiveMQ or HornetQ maybe used. This also allows you to scale A into multiple instances across many machines, and use JMS to request user information from the Desktop application.
Another option is to expose a simple API (REST, TCP etc) on the Desktop application and make the Web Service A talk to the Desktop application using that. Again, you could distribute the A into multiple instances for scalability.
You can use an ESB to convert a REST call to TCP, or a SOAP to JMS etc. Basically any-to-any conversion. The Free and Open Source ESB UltraESB [http://adroitlogic.org] contains many examples, and is lightweight (~35MB) so the 'overkill' will be minimal compared to > 300MB+ resource hungry ESBs

How to expose locally installed application as Web Service?

Suppose I have 2 web services A and B in SOA project. Both web services are running on a remote servers. Web Service A depends on information available from only a locally installed desktop application on a human actor machine and thats all web service A does i.e. provide this information). There are hundreds of such human actors with the same locally installed application providing its own information that web service A needs. Web service B needs this information from web service A, the result of which (which is the whole benefit of this project) is provided to that human actor who originated this process (by loging into system and clicking some command button). So this human actor is acting like the consumer of Web service B. The question is how can I make this locally installed application act as Web Service A (in the context of SOA project)?
This question could best be answered by some one with extensive experience in Web services and SOA.
This SOA project uses java, like ESB based on Java and there is no Microsoft specific services running although the desktop application is a Windows application. The application provides c/C++ API for an external process to call and retrieve the information needed by Web service A. What I want is the both web services A and B are hosted on remote server and interacting with each other via ESB but the problem is how to make local application information available to Web Service A?
There are two types of solutions
The first: have the original client application add a parameter with the address of web service A, and use this address for calling the service.
The second: pass a more abstract user identifier from the client (actually, there's a good chance you have such a field in the service). and use a translation service to retrieve the physical address corresponding to this id.
To allow such translation, the desktop application that acts as a server needs to "register" with the translation service when starting up.
If you are using an ESB, or other SOA infrastructure (like a service directory, message queuing service) it will include much of the functionality you need to build the translation service.
regarding the actual hosting of the service in the client machine.
the simplest solution is to use a different process from the actual application, and just access the files or DB the application uses.
In this case you can use any infrastructure you like to develop the service.
a more complex scenario is when you need the actual application to supply the service. in this case you will need to have a thread in the application that listens to service requests.
if you are using WCF see Hosting Services about how to host a web service in your application.
EDIT
some additions regarding you clarification.
as I understand, the desktop application exposes a C\C++ API that is available for external processes on the same machine.
You can either write a web service that will use this API. Googling "C++ Web Services Windows" will give yo several relevant pointers on implementing those.
Another good option is to use a messaging infrastructure. most JMS providers provide API's in languages other then Java - including C++.
Your application will be a C++ windows service that listens and sends messages to you JMS provider.