如何使用curl将请求发送到Wso2而不是ant



我对ESB还是非常非常陌生,我的第一个起点是WSO2。我正在通过网站上的教程,我能够正确地设置它。现在我的问题是如何使用curl向ESB服务器而不是Apache ant发出请求。

我想发送的请求是写在蚂蚁下面,目前工作良好。

ant stockquoat -Dtrpurl=http://localhost:8280/services/StockQuoatProxy -Dmode=quoat -Dsymbol=IBM
根据我的经验,我知道-D选项是用来传递参数的。

那么我如何在curl

中传递这个呢

curl命令

curl --header "Content-Type: text/xml;charset=UTF-8" --header "SOAPAction:urn:getQuote" --data @request.xml http://localhost:8280/services/StockQuoatProxy

request.xml文件应该包含这个有效负载

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:MessageID>urn:uuid:aff28543-56ba-4aef-982a-f74a685d777d</wsa:MessageID><wsa:Action>urn:getQuote</wsa:Action></soapenv:Header><soapenv:Body><m0:getQuote xmlns:m0="http://services.samples"><m0:request><m0:symbol>IBM</m0:symbol></m0:request></m0:getQuote></soapenv:Body></soapenv:Envelope>

最新更新