Is this Servlet registered by Resource type? If so - will be hard to invoke from a WOrkflow. If reg by resource type, you need:
The resource type(s) supported by the servlet. The property value must either be a single String, an array of Strings or a Vector of Strings. Either this property or the
sling.servlet.pathsproperty must be set, or the servlet is ignored. If both are set, the servlet is registered using both ways.
See this doc for an explanation -- Apache Sling :: Servlets and Scripts
If you want to call an AEM Service from a Workflow, create a custom AEM Service that contains QueryBuilder logic to do what you want. Write a custom AEM workflow step that invokes the custom service using @Reference annotation. That will invoke your service.
I have implemented using bundles .... it worked.
But i want to know the real difficulty in calling the servlet registered by resource type through http post.
It won;t work through a POST. That is because a Servlet registered via a resource type and is fired when that resource type is accessed- not in response to an event - like when we click a button - such as a submit button on a component.
See this doc for more information -- Scott's Digital Community: Binding Adobe Experience Manager Servlets to ResourceTypes
In your case I would re-implement the logic of the QueryServlet in your own code. A lot of code of this servlet is validating things and rerouting paramters to do some API calls. And instead of creating a wrapper around this wrapper servlet, study the code and use the QueryHelper services (and some others) to do that what you want.