-Does InvokeHttp works slow if calling https endpoint? - http

i am trying to expose an REST endpoint on NIFi with the help of hanldeHttpRequest and HandleHttpResponse processor.
The Purpose of this endpoint is to fetch data from other endpoint and present fetched data as http response through hanldeHttpResponse processor.
Below screen map be helpfull for more understanding.
I want some appropriate result

Related

Retrieve Repsonse Code from the Request Object

I need to create a middleware app that provides an api and consumes two apis. I am currently taking data from API A and creating data to send to API B via the HttpFoundation Request class. However, before I take the response from API B and send it back to API A; I would like to make sure that the HTTP Status Code is 200.
I don't see the ability to check for the status code when using the Request class.

Is it possible for a Prosody server to make an HTTP request to an external API

The Prosody server has several modules that allow it to respond to HTTP requests.
For example, mod_http_rest allows me to make a POST request on port 5280 with an XMPP stanza as the payload, and the Prosody server responds by sending that stanza on its way.
However, I am looking for a module that would do the opposite: i.e. take an XMPP message received by the usual means, and make an HTTP POST request to a specified server with that message as the payload.
I can't seem to find any module that will do this. Is there such a thing?
If not, is there any functionality available in the Prosody API that would allow such a module to be written?
Alternatively, are there good reasons why this might be a bad idea?
To answer your question, yes, it's possible for Prosody to make HTTP requests to external services.
The module you describe (take XMPP and forward it over HTTP) did not exist, but there's little reason for it not to. So I just published a module that provides this feature: https://modules.prosody.im/mod_component_http.html
I dont known if there is a module already for that but there is a way to achieve it yourself. I made my own module some months back for specific purposes and I used net.http which as the Docs say:
Is an API for making non-blocking HTTP requests to remote servers.
So you should check the Docs from here so you can use it like:
local req = require "net.http"
req.request( URL, opts, callBack )
Where opts are your options in json, and callBack is a function that defines what you want to do with the response.
I hope it helps.

Partial Response received from Apigee

The flow is SAP NWAS 7/Java AS ---> Apigee On Premise--->Apigee OnCloud -----> Backend. and back.
Backend is posting a response of appx 17 MB back. I have streaming enabled both on cloud and on premise Apigee. But the sap NWAS client states that only partial response is received .
When we invoke from POSTMAN however, we are getting complete response.
Please suggest where the problem can be?
Since Postman works fine for you, it seems like it might be a problem on the client side. So, it's possible that the client requires more info on the response in order to be able to display the content e.g. Content-Type header. Another way to troubleshoot this issue is to send a cURL command to the resource in Apigee and store it in the filesystem to validate that not only Postman can parse the response. e.g.
curl http://yourresourcehere/images/12344 > img12344.png

Read RSS feed with Biztalk

Is it possible to import the contents of an RSS feed with Biztalk?
I would like to import the RSS feed and send it to a Send port that put the content into a SQL Server database.
Thanks
You will need to start with an Xml Schema (XSD) that defines the RSS message - take a look at http://rss2schema.codeplex.com/ which defines an RSS 2.0 schema.
You would typically retrieve an RSS feed from a HTTP endpoint by issuing a HTTP GET request and the webserver would respond with the RSS content.
Unfortunately, the BizTalk HTTP Send Adapter (the thing that performs the HTTP request on your behalf) only supports the POST verb and I imagine you will find that the majority of websites won't let you retrieve an RSS feed by using POST.
There does appear to be a few options out there, including using a WCF-Custom Send Port (http://social.msdn.microsoft.com/Forums/en-US/biztalkgeneral/thread/3d001f89-88e2-4c67-8a54-2ea5a5f7c064/). If this seems like a lot of work, you might simply want to consider writing a WCF Service or Web-Service which would perform the GET Request which you invoke from BizTalk.
Once you have the RSS response message, simply parse and write to SQL using a Send Port configured with the SQL Adapter (or WCF-SQL Adapter).
I imagine that the lack of HTTP GET in the BizTalk HTTP Adapter is why nsoftware wrote its RSS adapter....
Since rss is basically an xml message, and BizTalk provides an HTTP protocol, it would seem reasonably simple.
Create a receive location to retrieve the rss feed
use an orchestration to load the content
Create a send port to connect to sql server to write the content you retrieved.
It's not trivial, but doesn't seem too difficult

Does REST send its payload in the URL of the request? What about SOAP?

Do SOAP and REST put their respective payloads as a URL? For example:
http://localhost/action/?var=datadatadata
I know SOAP uses XML and sometimes runs on a different port on the server, but do you still submit data like the example above or do you send it as one big XML encapsulated packet to that port?
It depends on your HTTP method. GET method will put everything into URL while POST method only put path information in URL and the rest of them are streamed into the HTTP request body.
SOAP should also rely on HTTP protocol and hence should follow the same rule. Check out http://www.w3.org/TR/soap12-part0/#L10309

Resources