我试图将 wsa 寻址“来自”SOAP 标头从一项服务传递到另一项服务,但我无法传递。我有以下情况
我有代理服务,我们将从中调用另一个 WSO2 数据服务。如果代理服务从数据服务接收到故障,我将该故障消息转发到也是代理服务的常见错误处理程序。
在将消息转发到错误处理程序代理服务之前的代理服务中,我使用以下标头调解器在调用代理服务中设置标头
<header name="Action" value="urn:mediate" />
<header name="From" value="http://localhost:8280/services/TQS_SFA_CUST_SRCH" />
<header name="To" value="http://localhost:8280/services/TQS_ERROR_HANDLER" />
但是,错误处理程序代理服务从未收到“From”标头,至少从未在日志或跟踪中显示。
由于这是常见的错误处理程序,我需要知道调用来自哪个服务,以便我可以根据调用服务处理错误。
如何设置 SOAP 寻址标头,以便能够在错误处理程序中看到“From”标头?我尝试了端点调解器以及属性的消息级别设置,以将消息发送到错误处理程序。我还在端点定义中启用了 WS 寻址。看起来没有任何工作。
以下是附加的跟踪日志供您参考。
16:05:55,451 [-] [HttpClientWorker-14] INFO TRACE_LOGGER Start : Property mediator
16:05:55,452 [-] [HttpClientWorker-14] INFO TRACE_LOGGER Setting property : FromWhichService at scope : transport to : TQS_SFA_CUST_SRCH (i.e. constant : TQS_SFA_CUST_SRCH)
16:05:55,452 [-] [HttpClientWorker-14] INFO TRACE_LOGGER End : Property mediator
16:05:55,452 [-] [HttpClientWorker-14] INFO TRACE_LOGGER Start : Header mediator
16:05:55,452 [-] [HttpClientWorker-14] INFO TRACE_LOGGER Set SOAP header : Action to : urn:mediate
16:05:55,453 [-] [HttpClientWorker-14] INFO TRACE_LOGGER End : Header mediator
16:05:55,453 [-] [HttpClientWorker-14] INFO TRACE_LOGGER Start : Header mediator
16:05:55,453 [-] [HttpClientWorker-14] INFO TRACE_LOGGER Set SOAP header : From to : /services/TQS_SFA_CUST_SRCH
16:05:55,453 [-] [HttpClientWorker-14] INFO TRACE_LOGGER End : Header mediator
16:05:55,453 [-] [HttpClientWorker-14] INFO TRACE_LOGGER Start : Header mediator
16:05:55,453 [-] [HttpClientWorker-14] INFO TRACE_LOGGER Set SOAP header : To to : http://localhost:8280/services/TQS_ERROR_HANDLER
16:05:55,454 [-] [HttpClientWorker-14] INFO TRACE_LOGGER End : Header mediator
16:05:55,454 [-] [HttpClientWorker-14] INFO TRACE_LOGGER Start : Log mediator
16:05:55,455 [-] [HttpClientWorker-14] INFO TRACE_LOGGER To: http://localhost:8280/services/TQS_ERROR_HANDLER, From: /services/TQS_SFA_CUST_SRCH, WSAction: urn:mediate, SOAPAction: urn:mediate, MessageID: urn:uuid:0ccdd39d-e96b-491b-ba53-2411b84fa950, Direction: response, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><axis2ns233:DataServiceFault xmlns:axis2ns233="http://ws.wso2.org/dataservice">Error obtaining parser from data source:DS Fault Message: Error in 'SQLQuery.processNormalQuery'
DS Code: DATABASE_ERROR
Source Data Service:-
Name: CUST_SRCH_D_DS
Location: /CUST_SRCH_D_DS-1.0.0.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: CUST_SRCH_OP
Current Params: {DSID={100008492,10001565,100016993,100097721}}
Nested Exception:-
DS Fault Message: Error in 'createProcessedPreparedStatement'
DS Code: UNKNOWN_ERROR
Nested Exception:-
com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [TeraJDBC 14.00.00.13] [Error 3810] [SQLState 42S22] Column/Parameter 'gca.a.peson_id' does not exist.
</axis2ns233:DataServiceFault></soapenv:Body></soapenv:Envelope>
16:05:55,455 [-] [HttpClientWorker-14] INFO TRACE_LOGGER End : Log mediator
16:05:55,455 [-] [HttpClientWorker-14] INFO TRACE_LOGGER Start : Send mediator
16:05:55,455 [-] [HttpClientWorker-14] INFO TRACE_LOGGER Receiving sequence is set to: Value {name ='null', keyValue ='conf:/tqs/common/ErrorRedirect_Seq.xml'}
16:05:55,455 [-] [HttpClientWorker-14] INFO TRACE_LOGGER Sending response message using implicit message properties..
Sending To: http://localhost:8280/services/TQS_ERROR_HANDLER
SOAPAction: urn:mediate
16:05:55,457 [-] [HttpClientWorker-14] INFO TRACE_LOGGER End : Send mediator
16:05:55,457 [-] [HttpClientWorker-14] INFO TRACE_LOGGER End : Filter mediator
16:05:55,458 [-] [HttpClientWorker-14] INFO TRACE_LOGGER Start : Log mediator
16:05:55,458 [-] [HttpClientWorker-14] INFO TRACE_LOGGER To: http://localhost:8280/services/TQS_ERROR_HANDLER,From: /services/TQS_SFA_CUST_SRCH,WSAction: urn:mediate,SOAPAction: urn:mediate,MessageID: urn:uuid:f71c97ef-1f32-43a4-9973-c68df81115db,Direction: response,OutSequence-ExitMessage = TQS_SFA_CUST_SRCH - Exiting OutSequence.,Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><axis2ns233:DataServiceFault xmlns:axis2ns233="http://ws.wso2.org/dataservice">Error obtaining parser from data source:DS Fault Message: Error in 'SQLQuery.processNormalQuery'
DS Code: DATABASE_ERROR
Source Data Service:-
Name: CUST_SRCH_D_DS
Location: /CUST_SRCH_D_DS-1.0.0.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: CUST_SRCH_OP
Current Params: {DSID={100008492,10001565,100016993,100097721}}
Nested Exception:-
DS Fault Message: Error in 'createProcessedPreparedStatement'
DS Code: UNKNOWN_ERROR
Nested Exception:-
com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [TeraJDBC 14.00.00.13] [Error 3810] [SQLState 42S22] Column/Parameter 'gca.a.peson_id' does not exist.
</axis2ns233:DataServiceFault></soapenv:Body></soapenv:Envelope>
16:05:55,459 [-] [HttpClientWorker-14] INFO TRACE_LOGGER End : Log mediator
16:05:55,459 [-] [HttpServerWorker-13] INFO TRACE_LOGGER Proxy Service TQS_ERROR_HANDLER received a new message from : 127.0.0.1
16:05:55,460 [-] [HttpClientWorker-14] INFO TRACE_LOGGER End : Sequence <anonymous>
16:05:55,461 [-] [HttpServerWorker-13] INFO TRACE_LOGGER Message To: /services/TQS_ERROR_HANDLER
16:05:55,461 [-] [HttpServerWorker-13] INFO TRACE_LOGGER SOAPAction: null
16:05:55,462 [-] [HttpServerWorker-13] INFO TRACE_LOGGER WSA-Action: null
16:05:55,462 [-] [HttpServerWorker-13] INFO TRACE_LOGGER Using the anonymous in-sequence of the proxy service for mediation
16:05:55,463 [-] [HttpServerWorker-13] INFO TRACE_LOGGER Start : Sequence <anonymous>
16:05:55,463 [-] [HttpServerWorker-13] INFO TRACE_LOGGER Setting the onError handler : conf:/tqs/common/FaultHandler_Seq.xml for the sequence : null
16:05:55,463 [-] [HttpServerWorker-13] INFO TRACE_LOGGER Sequence <SequenceMediator> :: mediate()
16:05:55,463 [-] [HttpServerWorker-13] INFO TRACE_LOGGER Start : Log mediator
16:05:55,464 [-] [HttpServerWorker-13] ERROR TRACE_LOGGER To: /services/TQS_ERROR_HANDLER,MessageID: urn:uuid:2893d313-b936-4b43-a551-538b26f7cb72,Direction: request,InSequence-EntryMessage = TQS_ERROR_HANDLER - Entering InSequence.,Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><axis2ns233:DataServiceFault xmlns:axis2ns233="http://ws.wso2.org/dataservice">Error obtaining parser from data source:DS Fault Message: Error in 'SQLQuery.processNormalQuery'
DS Code: DATABASE_ERROR
Source Data Service:-
Name: CUST_SRCH_D_DS
Location: /CUST_SRCH_D_DS-1.0.0.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: CUST_SRCH_OP
Current Params: {DSID={100008492,10001565,100016993,100097721}}
Nested Exception:-
DS Fault Message: Error in 'createProcessedPreparedStatement'
DS Code: UNKNOWN_ERROR
Nested Exception:-
com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [TeraJDBC 14.00.00.13] [Error 3810] [SQLState 42S22] Column/Parameter 'gca.a.peson_id' does not exist.
</axis2ns233:DataServiceFault></soapenv:Body></soapenv:Envelope>
16:05:55,464 [-] [HttpServerWorker-13] INFO TRACE_LOGGER End : Log mediator