問題描述
wso2代理服務出錯 (Error in wso2 proxy service)
我有以下使用 google 電子表格連接器的代理服務:
<?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]
我該如何解決這個問題?請幫忙
參考解法
方法 1:
The exception you're having is the following:
Unexpected character '[' (code 91) in prolog; expected '<'
This looks like it is an issue with the contentType. Is seems like you're sending JSON data (starting with [
), but the output formatter expects XML (starting with <
).
Add the following property to specify that you're sending json data:
<property name="messageType" value="application/json" scope="axis2"/>
(by Riyafa Abdul Hameed、FiveO)