首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >mule-esb ajax与google拼写检查的集成

mule-esb ajax与google拼写检查的集成
EN

Stack Overflow用户
提问于 2013-06-02 09:21:24
回答 1查看 482关注 0票数 0

我从mulesoft下载了最新的mule工作室,并开始研究第一个示例,

Windows 8: 64位。

Mule版本: 3.4.0

JRE: 7

项目名称为: test

buildDate: 201305141336

当我在浏览器中单击此链接时,出现以下错误:

https://www.google.com/tbproxy/spell?lang=en

代码语言:javascript
复制
This XML file does not appear to have any style information associated with it. The document tree is shown below.

      <spellresult error="1"/>

我的xml文件:

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:ajax="http://www.mulesoft.org/schema/mule/ajax" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/ajax http://www.mulesoft.org/schema/mule/ajax/current/mule-ajax.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
    <ajax:connector name="AjaxConnector" serverUrl="http://127.0.0.1:8090/Ajax" resourceBase="src/main/app/docroot" jsonCommented="true" doc:name="Ajax"/>
    <flow name="testFlow1" doc:name="testFlow1">
        <ajax:inbound-endpoint channel="services/echo" responseTimeout="10000" doc:name="Ajax Channel" connector-ref="AjaxConnector"/>
        <mulexml:object-to-xml-transformer doc:name="Convert JS to XML"/>
        <mulexml:xslt-transformer maxIdleTransformers="2" maxActiveTransformers="5" doc:name="Convert XML structure" xsl-file="F:\project\workspace\mulestudio\test\src\main\resources\transform.xsl"/>
        <http:outbound-endpoint exchange-pattern="request-response" host="www.google.com/tbproxy/spell?lang=en" port="80" method="POST" doc:name="Google API" contentType="text/xml"/>
        <echo-component doc:name="Echo to Console"/>
    </flow>
</mule>
EN

回答 1

Stack Overflow用户

发布于 2013-06-04 07:10:35

之所以会出现此错误,是因为通过浏览https://www.google.com/tbproxy/spell?lang=en,您正在向接受HTTP POST请求的资源发送HTTP GET请求。

尝试使用:

代码语言:javascript
复制
curl -H "Content-Type: application/xml" \
     -d '<spellrequest textalreadyclipped="0" ignoredups="0" ignoredigits="1" ignoreallcaps="0"><text>look at the butterfli</text></spellrequest>' \
     https://www.google.com/tbproxy/spell?lang=en

你会看到来自谷歌的拼写建议。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16878903

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档