簡體   English   中英

WSO2:流處理器

[英]WSO2: Stream Processor

如何配置@sink來調用基於Soap的Web API? 我在哪里可以指定肥皂動作? 我在網上找到的參考資料工作不正常?

    @sink(type='http',publisher.url='http://localhost:8009/foo', method='{POST}',headers="'content-type:xml','content-length:94'", client.bootstrap.configuration="'client.bootstrap.socket.timeout:20', 'client.bootstrap.worker.group.size:10'", client.pool.configuration="'client.connection.pool.count:10','client.max.active.connections.per.pool:1'", @map(type='xml', @payload('{<events>
    <event>
        <symbol>WSO2</symbol>
        <price>55.6</price>
        <volume>100</volume>
    </event>
</events>,
POST,
Content-Length:24#Content-Location:USA#Retry-After:120}')))

以下是配置示例,說明了如何調用SOAP端點。 在這里,我們將HTTP接收器XML源映射器一起使用 希望這能滿足您的要求。

@App:name("SiddhiAppSOAPTest")
@App:description("Description of the plan")

-- Please refer to https://docs.wso2.com/display/SP400/Quick+Start+Guide on getting started with SP editor. 

define stream inputStream(attr1 int);

@sink(type='http', publisher.url='http://localhost:8280/services/echo', method='POST',headers="'Content-Type:text/xml','SOAPAction:urn:echoInt'",
@map(type='xml', enclosing.element="<soapenv:Envelope xmlns:echo='http://echo.services.core.carbon.wso2.org' xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>",
    @payload( "<soapenv:Header/><soapenv:Body><echo:echoInt><in>{{attr1}}</in></echo:echoInt></soapenv:Body>")
)
)
define stream outputStream (attr1 int);

from inputStream
select *
insert into outputStream;

如您所見,我已經將SOAPAction定義為HTTP標頭以及Content-Type。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM