这是我试图传递的XML(值是假的)
<?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='222555333'/>
<cliente conta='90240728366170132' senha='54226484'/>
<acao_cobranca numero='153079' cancelar_cobranca='1' registrar_pagamento='0' registrar_pagamento_valor='' dt_registrar_pagamento='' cancelar_multa='0' permitir_pagamento='0' dt_permitir_pagamento='' reenviar_email='0' email_tosend=''/>
<acao_agendamento numero='123' cancelar_agendamento='0'/>
</m:F2bAcaoCobranca>
</soap-env:Body>
这是网络服务的网址
http://www.f2b.com.br/WSBillingAction
所以我尝试了很多东西。首先,我将URL放在开头,将XML字符串放在结尾处,它表示<
并未作为URL的一部分。所以我改变了立场,这是最后的尝试
curl -X POST -d "XML STRING" \ http://www.f2b.com.br/WSBillingAction
现在它说Protocol " http" not supported or disabled in libcurl
有关如何发送此消息的任何想法?
答案 0 :(得分:2)
删除反斜杠。您已在网址中首先添加了转义空间,并且网址不能包含空格!
修正后的行看起来像:
curl -d“XML STRING”http://www.f2b.com.br/WSBillingAction
或者您将XML存储在文件中,然后将其发送为
curl -d @xmlfile http://www.f2b.com.br/WSBillingAction