2

我正在使用 Google Task 连接器并最终出现以下错误

The content of element 'google-tasks:config-with-oauth' is not complete. One of '{"http://www.mulesoft.org/schema/mule/core":annotations, "http://www.mulesoft.org/schema/mule/google-tasks":oauth-callback-config}' is expected.

这是我的配置

 <google-tasks:config-with-oauth name="Google_Tasks"
 consumerKey="sagitec.mygbiz.com"
 consumerSecret="oeX9wb_GhldQJYjHKLDqC-EB" doc:name="Google Tasks"/>
     <flow name="google_taskFlow1" doc:name="google_taskFlow1">
         <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP"/>
         <google-tasks:authorize config-ref="Google_Tasks" accessTokenUrl="https://accounts.google.com/o/oauth2/token"
 authorizationUrl="https://accounts.google.com/o/oauth2/auth"
 access_type="online" force_prompt="auto" doc:name="Google Tasks"/>
         <logger level="INFO" doc:name="Logger" message="#[payload]"/> </flow>

如果我在 Oauth 选项卡下的 Domain(指定为可选)中输入“localhost” google-tasks:config-with-oauth,我不会收到任何构建错误。

所以我的第一个问题是,我必须在域下输入什么值以及我可以从哪里得到它。

2)Consumer Key/Secret和ClientKey/secret有什么区别。

3) 在其中一个样本中,我看到了${google.apiKey}. 这是什么,如果这是一个变量,wgere 以及如何声明它。

如果提供任何样品,那就太好了。

在此先感谢,卡南

4

1 回答 1

0

在这里,我添加了使用谷歌连接器进行谷歌日历身份验证的示例示例

您的

客户编号 >>consumerKey

客户秘密>>消费者秘密

${google.apiKey} >> 您的全球谷歌日历配置名称,即以下流程中的 name="Google_Calendars"

<?xml version="1.0" encoding="UTF-8"?>

    <mule xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-   mapper" xmlns:json="http://www.mulesoft.org/schema/mule/json"
    xmlns:https="http://www.mulesoft.org/schema/mule/https" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking"
    xmlns:objectstore="http://www.mulesoft.org/schema/mule/objectstore"
    xmlns:http="http://www.mulesoft.org/schema/mule/http"
    xmlns:google-calendars="http://www.mulesoft.org/schema/mule/google-calendars"
    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.5.2"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
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/google-calendars http://www.mulesoft.org/schema/mule/google-calendars/1.0/mule-google-calendars.xsd
http://www.mulesoft.org/schema/mule/objectstore http://www.mulesoft.org/schema/mule/objectstore/1.0/mule-objectstore.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/https http://www.mulesoft.org/schema/mule/https/current/mule-https.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd">

    <google-calendars:config-with-oauth
        name="Google_Calendars"
        consumerKey="${consumer-key}"
        consumerSecret="${consumer-secret}" doc:name="Google Calendars"
        applicationName="test">
        <google-calendars:oauth-callback-config
            domain="localhost" localPort="8083" path="list"
            remotePort="8083"  />
        <google-calendars:oauth-store-config objectStore-ref="ObjectStoreBean" />
    </google-calendars:config-with-oauth>


    <spring:beans>
        <spring:bean id="ObjectStoreBean" name="ObjectStoreBean"
            class="org.mule.util.store.SimpleMemoryObjectStore" />
    </spring:beans>
    <flow name="authorizationAndAuthenticationFlow" doc:name="authorizationAndAuthenticationFlow">
        <http:inbound-endpoint host="localhost" port="8080"
            path="oauth-authorize" doc:name="HTTP" />
        <google-calendars:authorize config-ref="Google_Calendars"
            doc:name="Google Calendars" />
        <http:response-builder status="200"
            doc:name="HTTP Response Builder">
            <set-payload value="You have successfully authorized the connector" />
        </http:response-builder>
        <catch-exception-strategy doc:name="Catch Exception Strategy">
            <http:response-builder status="404"
                doc:name="HTTP Response Builder">
                <set-payload value="An error has occurred authorizing the connector" />
            </http:response-builder>
        </catch-exception-strategy>
    </flow>     

</mule>
于 2015-07-09T08:16:49.147 回答