2015-11-26 124 views
0

我有以下代理servicethat使用谷歌电子表格连接器:错误WSO2代理服务

<?xml version="1.0" encoding="UTF-8"?> 
<proxy name="googleTest" startOnLoad="true" trace="disable" 
    transports="http https" xmlns="http://ws.apache.org/ns/synapse" statistics="disable"> 
    <target> 
    <inSequence> 
     <property name="messageType" scope="axis2" type="STRING" value="application/json"/> 
     <googlespreadsheet.updateCells configKey="access"> 
     <key>14sCud5RqFt7O44Ol_GnTBgwFbZSnWAW-dJ833ryfWY8</key> 
     <worksheetId>1</worksheetId> 
     <cellId>R2C6</cellId> 
     <inputValue>Inc</inputValue> 
     <row>2</row> 
     <col>6</col> 
     <cellVersion>1dzdhc</cellVersion> 
     </googlespreadsheet.updateCells> 
     <log level="full"/> 
    </inSequence> 
    <outSequence/> 
    <faultSequence/> 
    </target> 
</proxy> 

但是我运行这个代理,我得到以下错误:

[2015-11-26 19:15:04,506] ERROR - RelayUtils Error while building Passthrough stream 
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '[' (code 91) in prolog; expected '<' 
at [row,col {unknown-source}]: [1,1] 

我怎样才能解决这个问题?请帮助

回答

0

您遇到的例外是:

Unexpected character '[' (code 91) in prolog; expected '<'

这看起来是与contentType中的问题。好像你在发送JSON数据(从[开始),但输出格式化程序需要XML(从<开始)。

添加以下属性来指定要发送JSON数据:

<property name="messageType" value="application/json" scope="axis2"/> 
+0

感谢您的答复。它没有帮助 –

+0

请提供完整的代理代码和错误日志。当您拨打代理或发送给Google时,它会发生吗? – FiveO

+0

嗨我编辑代码,包括完整的代理服务 –