Mirth Connect integration with REST api - rest

Is there a way to call REST api (or any other RPC) in Mirth connect.
Here is the scenario, I want to be able check validity of some filed, by calling a REST API with the value of a field in an incoming record, then decide how to route it, is this possible

In mirth destinations there are HTTP sender and Web service sender. you could use HTTP sender to call rest ful services

Related

Capture incoming request information

I have an application wherein endpoints are configured on gravitee/api-gateway. My requirement is to be able to capture all the incoming requests on gravitee/api-gateway which includes their request-headers, uri, request body etc. and pass it onto a generic kind of rest api which further dumps the request related information to Apache Kafka.
I am unable to find the right way to capture the request data.
Any help is appreciated.

Should I be using REST or SOAP UI for testing?

I am testing a new webservice that is receiving messages from an application and responding with messages with specific information. The webservice then uses this information to create new messages for downstream systems. I need to know the best way I can test this using the Ready API tool, we just got a pro license. Is it SOAP or REST I need to use. Ideally I want to simply copy my application messages in to the tool, call the webservice and get the response, which I can then check is the correct response for the test
To find your web-service is SOAP or REST.
Please check whether your web service has WSDL to verify it has SOAP web-service, you can get your web-service's WSDL by post-fixing WSDL with your web service url.
Eg: http://{yourservice-url/path1}?WSDL
If your service don't provide WSDL from the above URL, then your web-service is REST.

Azure Logic App Custom Connector - SOAP to REST - Pass HTTP header from REST to SOAP request

In Azure I am able to create a Logic App Custom Connector to a SOAP API endpoint using Call Mode: SOAP to REST.
This SOAP Web Service needs an HTTP Header named Cookie with the value LoginCert=.
When modifying the Request of this connector I cannot find a way to add the Cookie HTTP header in the REST request and have that same Cookie be added to the SOAP request. Does anyone know how or if it is even possible to have HTTP headers from the REST request forwarded to the SOAP request made by the custom connector?
PS: This is possible in Azure via the API Management tool's REST to SOAP using the same WSDL, and then using the newly created REST endpoints inside of a Logic App Flow but this is not the solution.
TLDR: How can one add a HTTP header in an SOAP to REST Azure Logic App Custom Connector so the header is forwarded to the SOAP endpoint?
This is not currently supported by the SOAP to REST WSDL generated custom connectors for SOAP. You need indeed to either escape to APIM or you need to form the request payloads via LIQUID action then use the HTTP request action's advanced option to specify the cookie.

What's the REST way to verify an email?

When a user register to my web application I send an email to verify his inbox.
In the email there are a link to a resource like this:
GET /verify/{token}
Since the resource is being updated behind the scenes, doesn't it break the RESTful approach?
How can I do it in a RESTful manner?
What you are talking about is not REST. REST is for machine to machine communication and not for human to machine communication. You can develop a 1st party REST client, which sends the activation to the REST service.
You can use your verification URI in the browser to access the REST client:
# user follows a hyperlink in the browser manually
GET example.com/client/v1/verify/{token}
# asking the client to verify the token
and after that the REST client will get the hyperlink for verification from the REST service and send the POST to the service in the background.
# the REST client follows the hyperlinks given by the service automatically
# the REST client can run either on the HTTP client or server side
GET example.com/api/v1
# getting the starting page of the REST service
# getting the hyperlink for verification
POST example.com/api/v1/verification {token}
# following the verification hyperlink
If you have a server side 1st party REST client, then the HTTP requests to the REST service will run completely on the server and you won't see anything about it in the browser. If you have a client side REST client, then you can send the POST in the browser with AJAX CORS or you can try to POST directly with a HTML form (not recommended). Anyways the activation should be a POST or a PUT.
It depends on what are you trying to do.
Does it fire an email after validating the user for example? If so, it is not an idempotent method and you should use POST.
Example:
POST /users/{id}/verify/{token}
If the method doesn't have any consequence besides the update, I think you should use PUT.
Aren't you overthinking REST? With e-mail verification you want the user to be able to simply click the link from whatever mail user agent he is using, so you'll end up with a simple GET on the server (presented as a hyperlink to the user) with the token either in the path or as part of the query string:
GET http://example.com/verify-email/TOKEN
GET http://example.com/verify-email?token=TOKEN
Either is fine for this use case. It is not really a resource you are getting or creating; just a trigger for some process on the backend.
Why do you think this would run afoul of good design?

WSO2 ESB Topic Subscription for REST url

We are successfully using WSO2 ESB for basic mediation using REST for the caller and the service (via a message queue).
We are now trying to use the topics and subscription model. However, unlike in other parts of the ESB where you can modify the message format to POX, in the subscription interface there is way to define the format of the payload to the URL. The ESB always sends soap to the URL, even though we want it to send POX. We don;t want to have to write SOAP services.
Is there way to change the format that the subscriber gets? I know we can setup a proxy which then sends the message etc, but this is cumbersome and cannot be automated for new services.
If you use WS-Eventing, then you get the soap messages to the subscriber endpoints. You can use JMS based pub-sub scenario to implement what you want. Please have a look at [1].
[1] http://wso2.org/library/articles/2011/12/wso2-esb-example-pubsub-soa