Sorry, I know that you are trying to help me, but I don’t think that I get it.
But if I understand, what you are trying to say to me is in:
curl http://www.dneonline.com/calculator.asmx?wsdl -H 'Content-Type: text/xml' -d '
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:Add>
<tem:intA>1</tem:intA>
<tem:intB>2</tem:intB>
</tem:Add>
</soapenv:Body>
</soapenv:Envelope>'
http://www.dneonline.com/calculator.asmx?wsdl
is the <uri>
and the <data>
is:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:Add>
<tem:intA>1</tem:intA>
<tem:intB>2</tem:intB>
</tem:Add>
</soapenv:Body>
</soapenv:Envelope>
So I rewrote the extension:
[crm]
exten => _.,1,NoOp()
same => n,Set(CURLOPT(httpheader)=Content-Type: text/xml)
same => n,Verbose(0, ${CURL(http://www.dneonline.com/calculator.asmx,<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"><soapenv:Header/><soapenv:Body><tem:Add><tem:intA>1</tem:intA><tem:intB>2</tem:intB></tem:Add></soapenv:Body></soapenv:Envelope>)})
It give me a huge error:
[Nov 10 15:15:35] -- Executing [1@crm:1] NoOp("Console/dsp", "") in new stack
[Nov 10 15:15:35] -- Executing [1@crm:2] Set("Console/dsp", "CURLOPT(httpheader)=Content-Type: text/xml") in new stack
[2021-11-10 15:15:35] ERROR[30878][C-00000241]: func_curl.c:411 acf_curlopt_write: Unrecognized option: httpheader
[Nov 10 15:15:35] -- Executing [1@crm:3] Verbose("Console/dsp", "0, <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
[Nov 10 15:15:35] -- at System.Xml.XmlTextReaderImpl.Throw(Exception e)
[Nov 10 15:15:35] -- at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
[Nov 10 15:15:35] -- at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
[Nov 10 15:15:35] -- at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
[Nov 10 15:15:35] -- at System.Xml.XmlTextReaderImpl.Read()
[Nov 10 15:15:35] -- at System.Xml.XmlTextReader.Read()
[Nov 10 15:15:35] -- at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.Read()
[Nov 10 15:15:35] -- at System.Xml.XmlReader.MoveToContent()
[Nov 10 15:15:35] -- at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.MoveToContent()
[Nov 10 15:15:35] -- at System.Web.Services.Protocols.SoapServerProtocolHelper.GetRequestElement()
[Nov 10 15:15:35] -- at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest()
[Nov 10 15:15:35] -- at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message)
[Nov 10 15:15:35] -- at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
[Nov 10 15:15:35] -- at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response)
[Nov 10 15:15:35] -- at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
[Nov 10 15:15:35] -- --- End of inner exception stack trace ---</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>") in new stack
[Nov 10 15:15:35] <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
[Nov 10 15:15:35] at System.Xml.XmlTextReaderImpl.Throw(Exception e)
[Nov 10 15:15:35] at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
[Nov 10 15:15:35] at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
[Nov 10 15:15:35] at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
[Nov 10 15:15:35] at System.Xml.XmlTextReaderImpl.Read()
[Nov 10 15:15:35] at System.Xml.XmlTextReader.Read()
[Nov 10 15:15:35] at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.Read()
[Nov 10 15:15:35] at System.Xml.XmlReader.MoveToContent()
[Nov 10 15:15:35] at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.MoveToContent()
[Nov 10 15:15:35] at System.Web.Services.Protocols.SoapServerProtocolHelper.GetRequestElement()
[Nov 10 15:15:35] at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest()
[Nov 10 15:15:35] at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message)
[Nov 10 15:15:35] at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
[Nov 10 15:15:35] at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response)
[Nov 10 15:15:35] at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
[Nov 10 15:15:35] --- End of inner exception stack trace ---</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>
[Nov 10 15:15:35] -- Auto fallthrough, channel 'Console/dsp' status is 'UNKNOWN'
I try it with quotes, it gives the same error:
[crm]
exten => _.,1,NoOp()
same => n,Set(CURLOPT(httpheader)=Content-Type: text/xml)
same => n,Verbose(0, ${CURL(http://www.dneonline.com/calculator.asmx,'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"><soapenv:Header/><soapenv:Body><tem:Add><tem:intA>1</tem:intA><tem:intB>2</tem:intB></tem:Add></soapenv:Body></soapenv:Envelope>')})
And why the CURLOPT(httpheader)
still giving an error, it should be right at least.
[Nov 10 15:15:35] -- Executing [1@crm:2] Set("Console/dsp", "CURLOPT(httpheader)=Content-Type: text/xml") in new stack
[2021-11-10 15:15:35] ERROR[30878][C-00000241]: func_curl.c:411 acf_curlopt_write: Unrecognized option: httpheader