microsoft / botbuilder-java

The Microsoft Bot Framework provides what you need to build and connect intelligent bots that interact naturally wherever your users are talking, from text/sms to Skype, Slack, Office 365 mail and other popular services.
http://botframework.com
MIT License
179 stars 116 forks source link

Bot Framework SDK for Java using jakarta.servlet.http.HttpServlet as Bot Endpoint #1509

Closed devjp2k closed 1 year ago

devjp2k commented 1 year ago

I'm using a jakarta.servlet.http.HttpServlet as the endpoint in my Bot implementation, and I could use some assistance in handling the requests from Azure using the Bot Framework SDK for Java. This is what I have so far...

@Override
    public void doPost(HttpServletRequest request, HttpServletResponse response) {  

        String authHeader = request.getHeader("Authorization");         
        Activity activity = deserializeActivity(request);

        //What comes next?  Please Help!

    }

    /**
     * Deserializes the request body to a chatbot activity
     *
     * @param request Request object to read from
     * @return Returns the deserialized request
     * @throws IOException Gets thrown when the activity could not be deserialized
     */
    private Activity deserializeActivity(HttpServletRequest request) throws IOException {
        return objectMapper.readValue(request.getReader(), Activity.class);
    }

I would like to get the functionality shown in this sample

anishprasad01 commented 1 year ago

This question appears to be a "How-To" question that is a duplicate of this Stack Overflow question. We do not handle this type of question here, and we request that issues opened on the Bot Framework repositories be related to feature requests or bug reports.

This issue will be closed and we will attempt to answer your query on Stack Overflow, which should also increase visibility for those who may have a similar question in the future. If in the future you have a bug or feature request, please feel free to open a new issue in the appropriate repository.