Synapse

stWSO2ESB OutSequence Processing

拜拜、爱过 提交于 2020-02-16 05:23:08
问题 I'm transforming XML request to SOAP via XSLT in WSO2ESB, just wondering is it possible to make request parameter available to be used in response? E.g. <request> <test>123</test> <param1>testing</param1> </request> -> converted to SOAP <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">#S:Body><ns2:testrequest xmlns:ns2="http://xml.testing.com/test">

WSO2 ESB: Get URI in property from HTTP/Address Endpoint?

非 Y 不嫁゛ 提交于 2020-01-17 05:09:45
问题 I have a centrally defined endpoint that points to a RESTful API. At the moment it's a HTTP endpoint, but I can also work with an address endpoint if required. My issue is that I can't seem to find a way to access the endpoint URI in a property mediator (much like you would be able to with a LocalEntry). I need to embed the URI in a subsequent request, so I'd like to do something like: <property name="api_endpoint" expression="get-property('ApiEndpoint')"/> Where ApiEndpoint is the centrally

How to implement a custom mediator with its own XML configuration?

大兔子大兔子 提交于 2020-01-14 05:46:05
问题 I'm trying to implement a custom mediator for WSO2 ESB (4.5.1) using its own XML configuration. I'm able to use the mediator just fine as a class mediator with the following config: <class name="test.synapse.mediator.TestMediator"/> However, what I'm trying to achieve is being able to call the mediator with a syntax like this: <t:TestMediator xmlns:t="test:mediator" /> Having followed the available help on the matter for WSO2 ESB to the letter, I'm getting the following error as I try to

WSO2 ESB Getting a cookie from transport header with multiple cookies

荒凉一梦 提交于 2020-01-06 04:15:08
问题 I'm calling an authentication service with credentials and it responses back cookies with authentication info. I need that info for accessing a Web Service. The problem is that the authentication service returns a response with multiple cookies but I can only access to the first cookie from response it's the second cookie (WSL-external=VhTee1...) that I need for accessing the Web Service. The response I'm getting from the authentication server: HTTP/1.1 200 OK Content-Language: en-US Expires:

WSO2 ESB Mediation Sequence vs Proxy Service

大兔子大兔子 提交于 2020-01-04 13:48:27
问题 WSO2 ESB has Mediation Sequences and Proxy Services for implementing EAI patterns. I am currently new and couldn't distinguish when to use a Mediation Sequence or Proxy Service. Both seem to work well in most of the use cases. When should I use each? 回答1: Sequence (Mediation Sequence) is a sequence of Mediators. A message comes into the sequence, passes through the each mediator, in the order they are located in the sequence. So a Mediation Sequence is the generic building material of WSO2

Pass property from inSequence to outSequence

北城余情 提交于 2020-01-04 01:59:05
问题 I'm sending a message with a Proxy to a HL7 TCP/IP port and get the response in the outSequence. But my problem is that all properties set in the inSequence are not anymore available. All of them are null. I tested with all the different scopes (transport, axis2, axis2-client), but none of them worked. I saw in this post that it should be possible. Is the HL7 sender destroying the properties? How can use my properties from the inSequence in the outSequence? Example of my Proxy (get message

Supported XPath functions in WSO2 ESB 4.8.1

半世苍凉 提交于 2019-12-30 06:58:25
问题 The following XPath functions seem not be supported in WSO2 ESB 4.8.1: escape-html-uri() iri-to-uri() encode-for-uri() Does anyone know what XPath functions are supported and what are not supported in WSO2 ESB 4.8.1? 回答1: As far as I can tell from the JavaDocs, the synapse XPath implementation is built on Jaxen, which is XPath version 1.0 only. Therefore none of those functions will be supported, you only have the very limited function library of XPath 1.0 plus the synapse-specific get

Combine two queries using WSO2 ESB

情到浓时终转凉″ 提交于 2019-12-25 09:17:26
问题 I've been trying to figure out how to get WSO2's ESB to make calls to two different APIs and combine their results into a single response, and running into nothing but trouble. At its most basic, I've got two backends I'm making requests to that respond something like this: http://example.com/items : <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www

Using XPath functions in filter mediator

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 06:32:10
问题 In my inSequence of a proxy I'm filtering with a xpath query in the filter mediator. But I want to use XPath functions like exists() or count() . But this does not work and always creates an exception. Here my example: <filter xpath="count($body/myElement)>2"> <drop/> </filter> And the exception I always get: ERROR - FilterMediator Error evaluating XPath expression : n:exists($body/avintis:Exception) org.jaxen.UnresolvableException: No Such Function exists How can I make these functions work?

Howto extract data from the JSON body of REST request inside a WSO2 ESB Synapse handler

谁都会走 提交于 2019-12-24 16:31:05
问题 I'm writing a custom Handler for WSO2 ESB to construct authentication credentials based on input request content. Right now what I have is something like this: public boolean handleRequest(MessageContext context) { // TODO: extract relevant information (clientId) from JSON request body String clientId; Map<String, String> headers = (Map<String, String>) ((Axis2MessageContext) context).getAxis2MessageContext().getProperty( org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);