2013-05-03 95 views
2

我与谷歌的任务连接器玩,结束了以下错误谷歌的任务/日历

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标签下为google-tasks:config-with-oauth,我没有收到任何生成错误。

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

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

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

如果提供任何样品,这将是非常好的。

由于提前, 卡纳安

回答

0

这里我使用谷歌的连接器添加样品例如对于谷歌压延认证

客户端ID >> consumerKey

客户端秘密>> consumerSecret

$ {google.apiKey} >>您的全球Google日历配置名称即nam e =“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>