简体   繁体   中英

Sending XML with cURL command line and getting response

I am trying to integrate my web system with a SOAP API that has a very poor documentation. They just wrote a fee lines but didn't provide many examples of how to achieve the same results. I contacted them and they said I can use cURL to communicate with their webservice.

I have to send an XML and they will send an XML back in response. They provide this request example

<?xml version="1.0" encoding="UTF-8"?>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Body>
<m:F2bAcaoCobranca xmlns:m="http://www.f2b.com.br/soap/wsbillingaction.xsd">
<mensagem data="2005-04-18" numero="121233"/>
<cliente conta="9023010001230123" senha="senha123"/>
<acao_cobranca numero="153079" cancelar_cobranca="" registrar_pagamento=""
registrar_pagamento_valor="" dt_registrar_pagamento="" cancelar_multa="1"
permitir_pagamento="1" dt_permitir_pagamento="2005-05-20" reenviar_email="0"
email_tosend=""/>
<acao_agendamento numero="123" cancelar_agendamento="0"/>
</m:F2bAcaoCobranca>
</soap-env:Body>
</soap-env:Envelope>

I have to send requests to this URL

https://www.f2b.com.br/WSBillingAction

I have no further information about this API. Assuming that you are an expert with cURL, SOAP and XML (because I am not!), what are the best guesses to get a response from this server?

将请求放入文件“ request.xml”,然后使用

curl --header "content-type: text/soap+xml; charset=utf-8" --data @query.xml -k "https://www.f2b.com.br/WSBillingAction"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM