public ChatResponse chat(ChatConfig config){
  config.addCredentials(this);
  String xml=POST(this.url + "/post-chat",config.toXML());
  Element root=parse(xml);
  if (root == null) {
    return null;
  }
  try {
    ChatResponse response=new ChatResponse();
    response.parseXML(root);
    return response;
  }
 catch (  Exception exception) {
    this.exception=SDKException.parseFailure(exception);
    throw this.exception;
  }
}

public ChatResponse chat ( ChatConfig config ) { config . addCredentials ( this ) ; String xml = POST ( this . url + "/post-chat" , config . toXML ( ) ) ; Element root = parse ( xml ) ; if ( root == null ) { return null ; } try { ChatResponse response = new ChatResponse ( ) ; response . parseXML ( root ) ; return response ; } catch ( Exception exception ) { this . exception = SDKException . parseFailure ( exception ) ; throw this . exception ; } }
process the bot chat message and return the bot ' s response . the chatconfig should contain the conversation id if part of a conversation . if a new conversation the conversation id is returned in the response .
