WSO2 API Manager Проблема: "Нет информации о ресурсах в ответе"
Попытка реализовать REST API для бэкэнда SOAP, аналогичного примеру WSO2.
- WSO2 AM 2.1.0
- Java 8
- SOAP версия 1.1.
Используя следующую последовательность для JSON <-> SOAP Mediation.
наплыв
<sequence name="Login_JsonToSOAP" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<header name="identity-token" scope="transport" value=""/>
<payloadFactory media-type="xml">
<format>
<soap11:Envelope soap11:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:_01="http://www.ibsplc.com/icargo/services/AdminAccessControlService/2011/01/14_01/" xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/">
<soap11:Header>
<wsse:Security soap11:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-66695" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>USR1</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password1</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soap11:Header>
<soap11:Body>
<_01:mobilityLogin>
<request xmlns="">
<userCode>$1</userCode>
<userPassword>$2</userPassword>
</request>
</_01:mobilityLogin>
</soap11:Body>
</soap11:Envelope>
</format>
<args>
<arg evaluator="xml" expression="//request/userCode"/>
<arg evaluator="xml" expression="//request/userPassword"/>
</args>
</payloadFactory>
<property name="messageType" scope="axis2" type="STRING" value="text/xml"/>
<!-- log category="TRACE" level="full"/-->
<send>
<endpoint>
<address format="soap11" uri="http://remotehost:80/stg/services/AdminAccessControlService"/>
</endpoint>
</send>
отлив
Отток использует встроенную последовательность: xml_to_json_out_message
вопрос
Похоже, что исходящий поток не запускается или SOAP-ответ от серверной части не обрабатывается. Есть этот вывод в отладке [2017-10-26 16:06:41,731] DEBUG - API No resource information on the response: urn:uuid:67b8f452-24d0-480c-9974-c50933cd77ae
и впоследствии flowComplete()
вызывается без запуска последовательности обработки ответа (которая должна была преобразовать XML-ответ в JSON). Это приводит к таймауту соединения.
[2017-10-26 16:06:41,727] DEBUG - SynapseCallbackReceiver Body : <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body/></soapenv:Envelope>
[2017-10-26 16:06:41,727] DEBUG - Axis2SynapseEnvironment Injecting MessageContext
[2017-10-26 16:06:41,727] DEBUG - RESTRequestHandler Located specific API: admin--PFI:vv1.0 for processing message
[2017-10-26 16:06:41,727] DEBUG - API Processing message with ID: urn:uuid:67b8f452-24d0-480c-9974-c50933cd77ae through the API: admin--PFI
[2017-10-26 16:06:41,727] DEBUG - API Processing message with ID: urn:uuid:67b8f452-24d0-480c-9974-c50933cd77ae through handler: org.wso2.carbon.apimgt.gateway.handlers.common.APIMgtLatencyStatsHandler
[2017-10-26 16:06:41,727] DEBUG - API Processing message with ID: urn:uuid:67b8f452-24d0-480c-9974-c50933cd77ae through handler: org.wso2.carbon.apimgt.gateway.handlers.security.CORSRequestHandler
[2017-10-26 16:06:41,727] DEBUG - SequenceMediator Start : Sequence <_cors_request_handler_>
[2017-10-26 16:06:41,727] DEBUG - SequenceMediator Sequence <SequenceMediator> :: mediate()
[2017-10-26 16:06:41,727] DEBUG - SequenceMediator Mediation started from mediator position : 0
[2017-10-26 16:06:41,727] DEBUG - FilterMediator Start : Filter mediator
[2017-10-26 16:06:41,727] DEBUG - FilterMediator Source : $ctx:CORSConfiguration.Enabled against : true matches - executing child mediators
[2017-10-26 16:06:41,728] DEBUG - FilterMediator Sequence <FilterMediator> :: mediate()
[2017-10-26 16:06:41,728] DEBUG - FilterMediator Mediation started from mediator position : 0
[2017-10-26 16:06:41,728] DEBUG - FilterMediator Start : Filter mediator
[2017-10-26 16:06:41,728] DEBUG - FilterMediator Source : boolean($trp:Access-Control-Allow-Origin) against : false matches - executing child mediators
[2017-10-26 16:06:41,728] DEBUG - FilterMediator Sequence <FilterMediator> :: mediate()
[2017-10-26 16:06:41,728] DEBUG - FilterMediator Mediation started from mediator position : 0
[2017-10-26 16:06:41,728] DEBUG - PropertyMediator Start : Property mediator
[2017-10-26 16:06:41,728] DEBUG - PropertyMediator Setting property : Access-Control-Allow-Origin at scope : transport to : * (i.e. result of expression : $ctx:Access-Control-Allow-Origin)
[2017-10-26 16:06:41,728] DEBUG - PropertyMediator End : Property mediator
[2017-10-26 16:06:41,728] DEBUG - FilterMediator End : Filter mediator
[2017-10-26 16:06:41,728] DEBUG - FilterMediator Start : Filter mediator
[2017-10-26 16:06:41,728] DEBUG - FilterMediator Source : boolean($trp:Access-Control-Allow-Methods) against : false matches - executing child mediators
[2017-10-26 16:06:41,728] DEBUG - FilterMediator Sequence <FilterMediator> :: mediate()
[2017-10-26 16:06:41,728] DEBUG - FilterMediator Mediation started from mediator position : 0
[2017-10-26 16:06:41,728] DEBUG - PropertyMediator Start : Property mediator
[2017-10-26 16:06:41,728] DEBUG - PropertyMediator Setting property : Access-Control-Allow-Methods at scope : transport to : POST (i.e. result of expression : $ctx:Access-Control-Allow-Methods)
[2017-10-26 16:06:41,728] DEBUG - PropertyMediator End : Property mediator
[2017-10-26 16:06:41,728] DEBUG - FilterMediator End : Filter mediator
[2017-10-26 16:06:41,728] DEBUG - FilterMediator Start : Filter mediator
[2017-10-26 16:06:41,728] DEBUG - FilterMediator Source : boolean($trp:Access-Control-Allow-Headers) against : false matches - executing child mediators
[2017-10-26 16:06:41,729] DEBUG - FilterMediator Sequence <FilterMediator> :: mediate()
[2017-10-26 16:06:41,729] DEBUG - FilterMediator Mediation started from mediator position : 0
[2017-10-26 16:06:41,729] DEBUG - PropertyMediator Start : Property mediator
[2017-10-26 16:06:41,729] DEBUG - PropertyMediator Setting property : Access-Control-Allow-Headers at scope : transport to : authorization,Access-Control-Allow-Origin,Content-Type,SOAPAction (i.e. result of expression : $ctx:Access-Control-Allow-Headers)
[2017-10-26 16:06:41,729] DEBUG - PropertyMediator End : Property mediator
[2017-10-26 16:06:41,729] DEBUG - FilterMediator End : Filter mediator
[2017-10-26 16:06:41,729] DEBUG - FilterMediator Start : Filter mediator
[2017-10-26 16:06:41,729] DEBUG - FilterMediator Source : boolean($trp:Access-Control-Allow-Credentials) against : false matches - executing child mediators
[2017-10-26 16:06:41,729] DEBUG - FilterMediator Sequence <FilterMediator> :: mediate()
[2017-10-26 16:06:41,729] DEBUG - FilterMediator Mediation started from mediator position : 0
[2017-10-26 16:06:41,729] DEBUG - FilterMediator Start : Filter mediator
[2017-10-26 16:06:41,729] DEBUG - FilterMediator Source : boolean($ctx:Access-Control-Allow-Credentials) against : true does not match - skipping child mediators
[2017-10-26 16:06:41,729] DEBUG - FilterMediator End : Filter mediator
[2017-10-26 16:06:41,729] DEBUG - FilterMediator End : Filter mediator
[2017-10-26 16:06:41,729] DEBUG - FilterMediator End : Filter mediator
[2017-10-26 16:06:41,729] DEBUG - SequenceMediator End : Sequence <_cors_request_handler_>
[2017-10-26 16:06:41,729] DEBUG - API Processing message with ID: urn:uuid:67b8f452-24d0-480c-9974-c50933cd77ae through handler: org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler
[2017-10-26 16:06:41,729] DEBUG - API Processing message with ID: urn:uuid:67b8f452-24d0-480c-9974-c50933cd77ae through handler: org.wso2.carbon.apimgt.gateway.handlers.throttling.ThrottleHandler
[2017-10-26 16:06:41,729] DEBUG - API Processing message with ID: urn:uuid:67b8f452-24d0-480c-9974-c50933cd77ae through handler: org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtUsageHandler
[2017-10-26 16:06:41,729] DEBUG - API Processing message with ID: urn:uuid:67b8f452-24d0-480c-9974-c50933cd77ae through handler: org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtGoogleAnalyticsTrackingHandler
[2017-10-26 16:06:41,729] DEBUG - API Processing message with ID: urn:uuid:67b8f452-24d0-480c-9974-c50933cd77ae through handler: org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler
[2017-10-26 16:06:41,730] DEBUG - SequenceMediator Start : Sequence <admin--PFI:vv1.0--Out>
[2017-10-26 16:06:41,730] DEBUG - SequenceMediator Sequence <SequenceMediator> :: mediate()
[2017-10-26 16:06:41,730] DEBUG - SequenceMediator Mediation started from mediator position : 0
[2017-10-26 16:06:41,730] DEBUG - SequenceMediator Building message. Sequence <SequenceMediator> is content aware
[2017-10-26 16:06:41,730] DEBUG - RelayUtils Content Type is text/xml; charset=ISO-8859-1
[2017-10-26 16:06:41,730] DEBUG - Options getAction () from org.apache.axis2.client.Options@8bdf5dc
[2017-10-26 16:06:41,730] DEBUG - MessageContext SoapAction is ()
[2017-10-26 16:06:41,730] DEBUG - BuilderUtil char set encoding set from default =ISO-8859-1
[2017-10-26 16:06:41,730] DEBUG - AddressingHelper [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] isReplyRedirected: ReplyTo is null. Returning false
[2017-10-26 16:06:41,731] DEBUG - PropertyMediator Start : Property mediator
[2017-10-26 16:06:41,731] DEBUG - PropertyMediator Setting property : messageType at scope : axis2 to : application/json (i.e. constant : application/json)
[2017-10-26 16:06:41,731] DEBUG - PropertyMediator End : Property mediator
[2017-10-26 16:06:41,731] DEBUG - SequenceMediator End : Sequence <admin--PFI:vv1.0--Out>
[2017-10-26 16:06:41,731] DEBUG - API No resource information on the response: urn:uuid:67b8f452-24d0-480c-9974-c50933cd77ae
[2017-10-26 16:06:41,731] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() in Phase "OperationInPhase"
[2017-10-26 16:06:41,731] DEBUG - Phase [MessageContext:
logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() in Phase "MUPhase"
[2017-10-26 16:06:41,731] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() in Phase "AuthPhase"
[2017-10-26 16:06:41,731] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() in Phase "OpPhase"
[2017-10-26 16:06:41,731] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() in Phase "RMPhase"
[2017-10-26 16:06:41,731] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() in Phase "Dispatch"
[2017-10-26 16:06:41,731] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'Post dispatch security verification handler' in Phase 'Dispatch'
[2017-10-26 16:06:41,731] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'SynapseMustUnderstandHandler' in Phase 'Dispatch'
[2017-10-26 16:06:41,731] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'SynapseDispatcher' in Phase 'Dispatch'
[2017-10-26 16:06:41,731] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'MultitenantDispatcher' in Phase 'Dispatch'
[2017-10-26 16:06:41,731] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'HTTPLocationBasedDispatcher' in Phase 'Dispatch'
[2017-10-26 16:06:41,731] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'AddressingValidationHandler' in Phase 'Dispatch'
[2017-10-26 16:06:41,731] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'SOAPMessageBodyBasedDispatcher' in Phase 'Dispatch'
[2017-10-26 16:06:41,731] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'RequestURIOperationDispatcher' in Phase 'Dispatch'
[2017-10-26 16:06:41,731] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'SOAPActionBasedDispatcher' in Phase 'Dispatch'
[2017-10-26 16:06:41,732] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'RequestURIBasedDispatcher' in Phase 'Dispatch'
[2017-10-26 16:06:41,732] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() in Phase "PreDispatch"
[2017-10-26 16:06:41,732] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() in Phase "Security"
[2017-10-26 16:06:41,732] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'SecurityInHandler' in Phase 'Security'
[2017-10-26 16:06:41,732] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'Apache Rampart inflow handler' in Phase 'Security'
[2017-10-26 16:06:41,732] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() in Phase "Addressing"
[2017-10-26 16:06:41,732] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'AddressingBasedDispatcher' in Phase 'Addressing'
[2017-10-26 16:06:41,732] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'AddressingInHandler' in Phase 'Addressing'
[2017-10-26 16:06:41,732] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() in Phase "Transport"
[2017-10-26 16:06:41,732] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'CarbonContentConfigurator' in Phase 'Transport'
[2017-10-26 16:06:41,732] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'REST/POX Security handler' in Phase 'Transport'
[2017-10-26 16:06:41,732] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'SOAPActionBasedDispatcher' in Phase 'Transport'
[2017-10-26 16:06:41,732] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'CarbonContextConfigurator' in Phase 'Transport'
[2017-10-26 16:06:41,732] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'RequestURIBasedDispatcher' in Phase 'Transport'
[2017-10-26 16:06:41,732] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() in Phase "Validation"
[2017-10-26 16:06:41,732] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() in Phase "MsgInObservation"
[2017-10-26 16:06:41,732] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'InOnlyMEPHandler' in Phase 'MsgInObservation'
[2017-10-26 16:06:41,732] DEBUG - Phase [MessageContext: logID=4cd12a51acdfd6f8580f3b8f8b4b8b668a604c4fc9bb5616] Invoking flowComplete() for Handler 'TraceMessageBuilderDispatchHandler' in Phase 'MsgInObservation'
[2017-10-26 16:06:57,728] DEBUG - ThreadingView Thread state summary for PassthroughHttpServerWorker threads - Blocked: 0.0%, Unblocked: 100.0%
[2017-10-26 16:06:57,757] DEBUG - ThreadingView Thread state summary for PassthroughHttpServerWorker threads - Blocked: 0.0%, Unblocked: 100.0%
[2017-10-26 16:07:03,965] DEBUG - access - 127.0.0.1 - - [26/Oct/2017:16:06:41 +1000] "POST /pfi/v1.0/login HTTP/1.1" - 69 "-" "curl/7.43.0"
[2017-10-26 16:07:03,965] DEBUG - access - 192.168.219.70 - [26/Oct/2017:16:06:41 +1000] "- - " 200 - "-" "-"
[2017-10-26 16:07:03,966] DEBUG - access - 192.168.219.70 - - [26/Oct/2017:16:06:41 +1000] "POST /stg/services/AdminAccessControlService HTTP/1.1" - - "-" "Synapse-PT-HttpComponents-NIO"
[2017-10-26 16:07:41,585] DEBUG - SourceHandler http-incoming-4: Timeout
[2017-10-26 16:07:41,586] INFO - SourceHandler Writer null when calling informWriterError
[2017-10-26 16:07:41,586] WARN - SourceHandler Connection time out after request is read: http-incoming-4 Socket Timeout : 60000 Remote Address : /127.0.0.1:52595
[2017-10-26 16:07:41,586] DEBUG - SourceConnections Shutting down connection forcefully http-incoming-4
Есть ли какие-то ключи к тому, что проблема может быть в этой последовательности посредничества?