Вопрос

I want to connect to google server from my GWT Application, to integrate google chat into my Appllication. I have tried using the emite gwt library, but haven't been successful with the configuration needed to connect to the google server.

Any help on this is highly appreciated.

I am getting the following exception when trying to use Emite in GWT application.

00:01:07.158 [INFO] Thu Jan 24 16:54:19 IST 2013 com.calclab.emite.core.client.bosh.XmppBoshConnection SEVERE: Connection error #1: Bad status: 302

In web.xml

<servlet>
<servlet-name>Proxy</servlet-name>
<servlet-class>de.spieleck.servlets.ProxyServlet</servlet-class>
<init-param>
    <param-name>remotePath</param-name>
    <param-value>/http-bind/</param-value>
</init-param>
<init-param>
    <param-name>remoteServer</param-name>
    <param-value>talk.google.com</param-value>
</init-param>
<init-param>
    <param-name>remotePort</param-name>
    <param-value>5222</param-value>
</init-param>
</servlet>
<servlet-mapping>
    <servlet-name>Proxy</servlet-name>
    <url-pattern>/http-bind</url-pattern>
</servlet-mapping>

In GWTModule.html

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="emite.httpBase" content="/http-bind">
<meta name="emite.host" content="talk.google.com">
<meta name="emite.session" content="login">
<meta name="emite.onBeforeUnload" content="logout">
<meta name="emite.user" content="abc@gmail.com">
<meta name="emite.password" content="xxxxx">
<meta name="emite.chat" content="xxxx@gmail.com">

What am I missing here?

Regards

Это было полезно?

Решение

After some searches and tryouts - It seems that Google does not have their own bosh endpoint which would proxy request to google xmpp server. So, somehow ProxyServlet isn't working for me to connect to google server.

But now I am able to connect to google server using JabberHTTPBind. I used the emite-0.4.7-proxies.jar, which has JabberHTTPBind servlet bundled. In web.xml, added the below servlet mapping

    <servlet>
        <servlet-name>Jabber HTTP Binding Servlet</servlet-name>
        <servlet-class>org.jabber.JabberHTTPBind.JHBServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Jabber HTTP Binding Servlet</servlet-name>
        <url-pattern>/http-bind/*</url-pattern>
    </servlet-mapping>

This worked for me. And now I am able to connect to google server using Emite.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top