I'm trying to create service which will interact between main service and remote api using http and websockets.
I need to send data from main platform to API and than react to API incoming events imediantly.
Remote API has two parts: Http and WS. I understand how to interact with http part but don't clearly understand about ws.
My main platform, service and sdk wrote by PHP. Also for service I use Redis as DB for save data of incoming events and their statuses.
I think I can setup WS server to send data through it to remote API. But I don't see all picture.
scheme that I imagine
How I imagine a hypothetical scenario:
Core platform - create event
My service handle this event, save data to Redis to check and for example change status,
format data and send it through my SDK to WS server
WS server has WebSocket connection with remote API. It publish my data to this stream
Remote API get this data and return response
Than, WS server is waiting incoming events from remote API
If server receive incoming data, it send it to my service (or create event which my service will catch?)
When service got incoming data it handle it and create event which main platform can handle
Am I right or it's wrong approach? Welcome to any help and tools titles :)
Related
I am currently using laravel as my backend with a API built for android client
thats consumes the api.
I have configured websockets with PUSHER to handle new changes on server to be pushed to subscribed clients to avoid a server polling.
But sometimes the client need to go to server to get initial data from multiple endpoints or more than one image resources.
I have found the two libraries for laravel that help in implementing web side of laravel HTTP2 complaint
1 -> https://github.com/tomschlick/laravel-http2-server-push
2 -> https://github.com/JacobBennett/laravel-HTTP2ServerPush
from this link https://laravel-news.com/http2-server-push-middleware
So the question is it possible to implement HTTP2 on REST API endpoint where the client need to hit multiple url subsequently.
One solution can to inlucde all the resources in a single response, but that can be done only if all the responses are JSON.
How can I push json along with some small images.
I have a web app hosted in Firebase in vue.js. The app access to the organization's main database via API to a back-end server developed in PHP (laravel) hosted in GAE.
I'd like to know if using Firebase Cloud Function on the client (js) to make calls to a back end API (PHP) would help me to protect data and be more efficient authenticating calls from the client to back end.
Currently:
Users login into the client using Firebase Auth and the client sends the resulting token to my back-end server on each API call. Then the back-end verifies the token received via HTTPS using FB Auth API and then if verified, the backend would return the request data via JSON back to the client-side via HTTPS response.
My 2 biggest concerns are:
1) would this approach scale well with more users.
2) for large extractions of data, i.e. 1000+ rows. I'd like to avoid to have JSON objects being "downloaded" on the client.
New Scenario:
The users would still log in on the client (vue.js) using FB Auth, but the Client would use FB Cloud Functions to make the calls to the Back-End API data hosted on GAE and then return the data as an array.
The advantages I hope to utilize are:
- The client will not have https traffic with data as this would be handled by FBCF and send to the client via socket (?).
- Save verification auth calls from the server, IF there is a way for FBCF to make calls to GAE without the need to pass the token (maybe using endpoints?)
Does this make sense or am I introducing a middle man unnecessarily?
I have made a phonegap app and i want to know how to connect it to the database in my hosting website and add data?
Activate Internet permission and then use an AJAX like function to call a WEB API. This could be a script hosted from your hosting company which when called returns the data which you require in your app. This should ideally be in a standard format like JSON or XML.
Read more about REST APIs.
Read this to learn about REStfull APIs and Services.
See this post from 2011 which pulls a REST API.
API / Web Service is a code which can be written in any server side language like PHP. This script will communicate with with your Database.
These API/ Web service can be called from client, client can be a Web App / Web Site/ Mobile app, using HTTP METHODS (POST, GET etc). This API request will give response to the particular client with expected result (i.e. fetching data from database etc) and the response format can be JSON/ XML.
For more information you can Refer.
I'm an experienced data analist with mostly SQL and R experience, little Python, and unfortunately little .NET and PHP exposure. I have searched extensively for anyone with a similar questions, but unfortunately I haven't found what I'm looking for.
Situation: I'm setting up an HDInsight cluster on Azure (with Apache Spark) and I need to pull in some data from a SOAP API (no restful API).
Problem: Where and how do I pull this data in? I thought the Logic App in Azure would be a suitable place. However, I don't quite succeed in calling on this API.
I do have a working PHP script with a proper API call. Here is a (part of) the syntax.
$client = new SoapClient('http://someURL?wsdl');
$webservice = new SoapClient('http://someotherURL?wsdl');
$session = $client->someOperationToLogin($var1, $var2, $var3);
$operation = $webservice->someOperationToGetData($session, $var4, $var5);
$session = $client->logout($session);
As you can see, I first need to obtain a session id and then use this session id in subsequent calls. As far as I understand, I can't get to this data through a simple HTTP request.
Questions:
Can I call this particular SOAP API directly through one of the existing connectors in the Azure Logic App
If (1) is not possible, can I make use of the existing PHP script? How and where?
Is there any other route I can follow to make use of the data through this SOAP API? For instance: using pyspark in the Spark/HDInsight Cluster?
I really appreciate your help and pointers.
You Can Make The Call Through The Normal HTTP Connector.
1- First Set Your Http trigger method to post and send it your xml Body.
HTTP Trigger
2- Make An Http Action with the url to Your Soap End like
abc.asmx
xyz.svc Http Call To Soap End
Don`t forget to set the Method To Post and Content-Type to text/xml as a header.
3- Finally Bind your Http Response to response action set the status code and body To the HTTP Action Status and Body Dynamically don`t forget to set to content type Here to text/xml as well Return Response Action
4- Finally Configure the run After for response component to sun after HttP Action Even If Faild , Cancled or time out Just to pass the Status code for every call Like That Right click on Response and configure run after conf Run After For response Action .
Here is The Full View Full Flow.
Like The Response If This helps.
There are no SOAP APIs called thru the existing connectors in Azure Logic App.
This is a list of Connectors and API Apps Reference: https://msdn.microsoft.com/en-us/library/azure/dn948518.aspx.
Their supported functions are all based on REST APIs via Http/Https.
All services & apis on Azure are almost based on REST APIs to compatible with crossover platform & language scenes.
But even so, you can create own SOAP APIs thru Azure App Service or Cloud Service.Please refer to http://azure.microsoft.com/en-us/documentation/services/app-service/api/ and https://azure.microsoft.com/en-us/documentation/articles/app-service-logic-arm-with-api-app-provision/.
In Azure HDInsight, you can pull in some data from Storage Service and Service Bus. If you want to use Azure Logic App, the exisiting connectors are Blob Connector and ServiceBus Connector, and even Dropbox Connector.
You can refer to the references below to use PHP script to access the Azure Storage & ServiceBus services linked as HDInsight resources to store/get or send/receive some data.
1.https://azure.microsoft.com/en-us/documentation/articles/storage-php-how-to-use-blobs/
2.https://azure.microsoft.com/en-us/documentation/articles/service-bus-php-how-to-use-queues/.
Best Regards.
It is now possible to create a REST API from a SOAP WSDL file through Azure API Management using the SOAP to Rest feature.
This can be accessed from:
Azure portal -> API Management services -> <Your API Management Service> -> APIs -> Add API -> WSDL
After this is set up, it is easy to access this API from other Azure products.
We have integrated DocuSign into our application and users are filling all the info and completing the docusign process. Also, we have implemented the functionality using docusign soap API to download envelop that status completed.
But now we want to download all the envelops that are completed. Is there any REST API or Soap API in php to download bulk envelops at a time. If yes please provide the details with examples.
Thanks,
Srinivas Reddy .A
Congratulations on your integration successes!
Do you want to download envelope information or the documents from the envelopers?
Use Connect
The usual technique for integrating completed envelope transactions and documents into existing systems is to use some form of the Connect feature. Connect enables you to establish a web hook, a listener, that is called by the DocuSign platform when envelopes or individual signature requests have reached a particular status level.
When you make an Envelope request through the API, you can include a call back "Connect" url as part of the request. See the eventNotification parameter
You can also establish a Connect listener at the account level instead of including the data with each envelope creation. Your Connect listener can be configured via the API or via the Preferences section of the Classic DocuSign Web App.
Message content documentation when your web hook listener is called by Connect
Another idea is to use the Retrieve product. It downloads completed envelopers and signed documents for you, to a windows server. You can then use local processes to store the data and completed documents.
Documents from envelopes
The API method Get Document from Envelope enables you to retrieve a specific document from an envelope.
Get Envelope Documents and Certificate enables you to retrieve all of the documents.
For both of these, you'd need to first loop through your envelopes to find the ones with the completed status.