我正在尝试使用此处的wso2教程实现服务:
不确定我做错了什么。 DSS服务不断返回202和ESB API服务。
API代码
Collapsed
这两个序列是
<api xmlns="http://ws.apache.org/ns/synapse" name="OrganizationalInfoAPI" context="/internal">
<resource methods="POST" uri-template="/employees">
<inSequence>
<sequence key="conf:/ProcessPayloadForEmpDSSSequence"></sequence>
<header name="Action" value="urn:insert_employee_operation"></header>
<call>
<endpoint>
<address uri="http://192.168.1.167:9773/services/EmployeesDataService.SOAP11Endpoint/" format="soap11"></address>
</endpoint>
</call>
<sequence key="conf:/ProcessResponseFromEmpDSSService"></sequence>
<respond></respond>
</inSequence>
</resource>
</api>
和
<sequence xmlns="http://ws.apache.org/ns/synapse">
<payloadFactory media-type="xml">
<format>
<p:insert_Employee_operation xmlns:p="http://employees.us.wso2.com">
<xs:FirstName xmlns:xs="http://employees.us.wso2.com">$1</xs:FirstName>
<xs:LastName xmlns:xs="http://employees.us.wso2.com">$2</xs:LastName>
<xs:Team xmlns:xs="http://employees.us.wso2.com">$3</xs:Team>
</p:insert_Employee_operation>
</format>
<args>
<arg expression="$.employee.firstName" evaluator="json"></arg>
<arg expression="$.employee.lastName" evaluator="json"></arg>
<arg expression="$.employee.team" evaluator="json"></arg>
</args>
</payloadFactory>
我错过了什么。有什么帮助吗?
这是在wso2esb控制台中:
<sequence xmlns="http://ws.apache.org/ns/synapse">
<payloadFactory media-type="json">
<format>{"EmployeeRecord":{"EmployeeID":$1, "Status":"Successfully created"}}</format>
<args>
<arg expression="$.GeneratedKeys.Entry.ID" evaluator="json"></arg>
</args>
</payloadFactory>
<property name="messageType" value="application/json" scope="axis2" type="STRING"></property>
</sequence>
这是请求的log4j文件
[2015-08-03 19:56:20,777] ERROR - RelayUtils Error while building Passthrough st
ream
org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: ParseError
at [row,col]:[1,1]
Message: Premature end of file.
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.jav
a:296)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelo
pe(StAXSOAPModelBuilder.java:204)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSO
APModelBuilder.java:154)
at org.apache.axiom.om.impl.AbstractOMMetaFactory.createStAXSOAPModelBui
lder(AbstractOMMetaFactory.java:73)
at org.apache.axiom.om.impl.AbstractOMMetaFactory.createSOAPModelBuilder
(AbstractOMMetaFactory.java:79)
at org.apache.axiom.om.OMXMLBuilderFactory.createSOAPModelBuilder(OMXMLB
uilderFactory.java:196)
at org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuilder.java
:55)
at org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.get
Document(DeferredMessageBuilder.java:118)
at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(R
elayUtils.java:107)
at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(Re
layUtils.java:82)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractLis
tMediator.java:68)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMe
diator.java:239)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromCont
inuationStateStack(Axis2SynapseEnvironment.java:556)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(A
xis2SynapseEnvironment.java:198)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(S
ynapseCallbackReceiver.java:488)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(Synapse
CallbackReceiver.java:170)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.j
ava:225)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(Native
WorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: Premature end of file.
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLS
treamReaderImpl.java:598)
at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStr
eamReaderWrapper.java:225)
at org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWra
pper.next(DisallowDoctypeDeclStreamReaderWrapper.java:34)
at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStr
eamReaderWrapper.java:225)
at org.apache.axiom.util.stax.dialect.SJSXPStreamReaderWrapper.next(SJSX
PStreamReaderWrapper.java:138)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuild
er.java:681)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.jav
a:214)
... 21 more
[2015-08-03 19:56:20,779] ERROR - SequenceMediator Error while building message
org.apache.axis2.AxisFault: Error while building Passthrough stream
at org.apache.synapse.transport.passthru.util.RelayUtils.handleException
(RelayUtils.java:236)
at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(R
elayUtils.java:111)
at org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(Re
layUtils.java:82)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractLis
tMediator.java:68)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMe
diator.java:239)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromCont
inuationStateStack(Axis2SynapseEnvironment.java:556)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(A
xis2SynapseEnvironment.java:198)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(S
ynapseCallbackReceiver.java:488)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(Synapse
CallbackReceiver.java:170)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.j
ava:225)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(Native
WorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException:
ParseError at [row,col]:[1,1]
Message: Premature end of file.
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.jav
a:296)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelo
pe(StAXSOAPModelBuilder.java:204)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSO
APModelBuilder.java:154)
at org.apache.axiom.om.impl.AbstractOMMetaFactory.createStAXSOAPModelBui
lder(AbstractOMMetaFactory.java:73)
at org.apache.axiom.om.impl.AbstractOMMetaFactory.createSOAPModelBuilder
(AbstractOMMetaFactory.java:79)
at org.apache.axiom.om.OMXMLBuilderFactory.createSOAPModelBuilder(OMXMLB
uilderFactory.java:196)
at org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuilder.java
:55)
at org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.get
Document(DeferredMessageBuilder.java:118)
at org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(R
elayUtils.java:107)
... 13 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: Premature end of file.
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLS
treamReaderImpl.java:598)
at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStr
eamReaderWrapper.java:225)
at org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWra
pper.next(DisallowDoctypeDeclStreamReaderWrapper.java:34)
at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStr
eamReaderWrapper.java:225)
at org.apache.axiom.util.stax.dialect.SJSXPStreamReaderWrapper.next(SJSX
PStreamReaderWrapper.java:138)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuild
er.java:681)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.jav
a:214)
... 21 more
[2015-08-03 19:56:20,781] ERROR - SynapseCallbackReceiver Synapse encountered an
exception, No error handlers found - [Message Dropped]
Error while building message