我有一个简单的 RESTRequest 节点。作为响应,我从SOAP-UI原型发送JSON。 JSON看起来像这样:
{
"SnapshotVersion": "43f4acca-b11a-4afe-b9bb-30af9864c3a0",
"TotalExtraPrice": 0,
"TotalPrice": 0,
"Příliš žluťoučký Kůň": "úpěl dábelské ódy"
}
如果仅发送前3个元素,则JSON解析器不会引发解析器异常,但是当添加"Příliš žluťoučký Kůň": "úpěl dábelské ódy"
元素时,解析器会引发以下消息:
JSON
Data
SnapshotVersion:CHARACTER:43f4acca-b11a-4afe-b9bb-30af9864c3a0
TotalExtraPrice:INTEGER:0
TotalPrice:INTEGER:0
CHARACTER:Unconvertable character
CHARACTER:JSON parsing errors have occurred
我尝试了this修复,但是没有用:
SET OutputRoot.HTTPRequestHeader."Content-Type" = 'application/json; charset=utf-8';
我什至尝试发送SOAP-UI标头Content-Type: application/json; charset=utf-8
我的属性和 HTTPResquestHeader 如下:
Properties
MessageSet:CHARACTER:
MessageType:CHARACTER:
MessageFormat:CHARACTER:
Encoding:INTEGER:546
CodedCharSetId:INTEGER:1208
Transactional:BOOLEAN:true
Persistence:BOOLEAN:false
CreationTime:TIMESTAMP:java.util.GregorianCalendar[time=1551971569190,areFieldsSet=true,areAllFieldsSet=false,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Europe/Prague",offset=3600000,dstSavings=3600000,useDaylight=true,transitions=141,lastRule=java.util.SimpleTimeZone[id=Europe/Prague,offset=3600000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=?,YEAR=2019,MONTH=2,WEEK_OF_YEAR=?,WEEK_OF_MONTH=?,DAY_OF_MONTH=7,DAY_OF_YEAR=?,DAY_OF_WEEK=?,DAY_OF_WEEK_IN_MONTH=?,AM_PM=1,HOUR=4,HOUR_OF_DAY=16,MINUTE=12,SECOND=49,MILLISECOND=190,ZONE_OFFSET=?,DST_OFFSET=?]
ExpirationTime:INTEGER:-1
Priority:INTEGER:0
ReplyIdentifier:BLOB:[B@3613bded
ReplyProtocol:CHARACTER:MQ
Topic:UNKNOWN:null
ContentType:CHARACTER:application/json; charset=utf-8
IdentitySourceType:CHARACTER:
IdentitySourceToken:CHARACTER:
IdentitySourcePassword:CHARACTER:
IdentitySourceIssuedBy:CHARACTER:
IdentityMappedType:CHARACTER:
IdentityMappedToken:CHARACTER:
IdentityMappedPassword:CHARACTER:
IdentityMappedIssuedBy:CHARACTER:
HTTPRequestHeader
Content-Type:CHARACTER:application/json; charset=utf-8
我认为这仍然必须是带有编码或ccsid的东西。
编辑1:
IIB版本: 10.0.0.13
完整错误消息:
ExceptionList
RecoverableException
File:CHARACTER:F:\build\slot2\S1000_P\src\DataFlowEngine\MessageServices\ImbDataFlowNode.cpp
Line:INTEGER:1251
Function:CHARACTER:ImbDataFlowNode::createExceptionList
Type:CHARACTER:ComIbmMQInputNode
Name:CHARACTER:API18099_O_CCGetV2#FCMComposite_1_6.vwg/skoda/eai/generic/in/mq/GEN90040_Generic_In_MQ#FCMComposite_1_1
Label:CHARACTER:API18099_O_CCGetV2.GEN90040_Generic_In_MQ.MQ Input
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Node throwing exception
Insert
Type:INTEGER:14
Text:CHARACTER:API18099_O_CCGetV2.GEN90040_Generic_In_MQ.MQ Input
RecoverableException
File:CHARACTER:F:\build\slot2\S1000_P\src\DataFlowEngine\SQLNodeLibrary\ImbComputeNode.cpp
Line:INTEGER:515
Function:CHARACTER:ImbComputeNode::evaluate
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:API18099_O_CCGetV2#FCMComposite_1_5
Label:CHARACTER:API18099_O_CCGetV2.MapAndRouteBack
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Caught exception and rethrowing
Insert
Type:INTEGER:14
Text:CHARACTER:API18099_O_CCGetV2.MapAndRouteBack
RecoverableException
File:CHARACTER:F:\build\slot2\S1000_P\src\DataFlowEngine\ImbRdl\ImbRdlStatementGroup.cpp
Line:INTEGER:792
Function:CHARACTER:SqlStatementGroup::execute
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2488
Text:CHARACTER:Error detected, rethrowing
Insert
Type:INTEGER:5
Text:CHARACTER:.API18099_O_CCGetV2_MapAndRouteBack.Main
Insert
Type:INTEGER:5
Text:CHARACTER:43.4
Insert
Type:INTEGER:5
Text:CHARACTER:SET refOutBody = InputRoot.JSON.Data;
RecoverableException
File:CHARACTER:F:\build\slot2\S1000_P\src\CommonServices\ImbConverter.cpp
Line:INTEGER:628
Function:CHARACTER:ImbConverterCPP::internalToUnicode
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2135
Text:CHARACTER:Unconvertable character
Insert
Type:INTEGER:5
Text:CHARACTER:f8
Insert
Type:INTEGER:5
Text:CHARACTER:50f8ed6c699a209e6c759df375e86bfd204bf9f2
Insert
Type:INTEGER:2
Text:CHARACTER:1208
在我使用严重解析的json消息进行某些映射之后,抛出了错误消息。
答案 0 :(得分:0)
Soap-UI有点棘手。
我的错误是在响应标头中发送Content-Type(因为它被回答here),但是此后,即使标头设置正确,Soap-UI响应仍采用不同于UTF-8的编码。
对于UTF-8,您必须设置参数JAVA_OPTS=-Dfile.encoding=UTF8
<Soap-UI home>\bin\soapui.bat
中(对于.zip版本)<Soap-UI home>\bin\SoapUI-5.4.0.vmoptions
中(对于.exe版本)