Hello !
I have a problem with http post to a soap server . Can anyone help me ?
I need to post this RAW code ( works with SOAP Client ! ).
Host: sampleshop.com
User-Agent: Mac OS X; WebServicesCore.framework (1.1.0)
Content-Type: text/xml
Soapaction: Webservices#SOAP_test
<SOAP-ENV:Envelope
xmlns:xsd=“http://www.w3.org/2001/XMLSchema”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xmlns:SOAP-ENC=“http://schemas.xmlsoap.org/soap/encoding/”
SOAP-ENV:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”
xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/”>
SOAP-ENV:Body
<m:SOAP_Article_getInformation xmlns:m=“http://www.adomain.com”>
<customer_number xsi:type=“xsd:string”>123456</customer_number>
<customer_password xsi:type=“xsd:string”>123456</customer_password>
<mandant_id xsi:type=“xsd:int”>1</mandant_id>
<language_nr xsi:type=“xsd:int”>1</language_nr>
<article_number xsi:type=“xsd:string”>ABC-123</article_number>
</m:SOAP_test>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
my code:
function soap () {
//same as raw code + \n
var httpCode=
‘<?xml version="1.0" encoding="UTF-8"?>’ + ‘\n’
‘<SOAP-ENV:Envelope’ + ‘\n’
‘xmlns:xsd=“http://www.w3.org/2001/XMLSchema”’ + ‘\n’
‘xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”’ + ‘\n’
‘xmlns:SOAP-ENC=“http://schemas.xmlsoap.org/soap/encoding/”’ + ‘\n’
‘SOAP-ENV:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”’ + ‘\n’
‘xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/”>’ + ‘\n’
‘SOAP-ENV:Body’ + ‘\n’
‘<m:SOAP_Article_getInformation xmlns:m=“http://www.adomain.com”>’ + ‘\n’
‘<customer_number xsi:type=“xsd:string”>123456</customer_number>’ + ‘\n’
‘<customer_password xsi:type=“xsd:string”>123456</customer_password>’ + ‘\n’
‘<mandant_id xsi:type=“xsd:int”>1</mandant_id>’ + ‘\n’
‘<language_nr xsi:type=“xsd:int”>1</language_nr>’ + ‘\n’
‘<article_number xsi:type=“xsd:string”>ABC-123</article_number>’ + ‘\n’
‘</m:SOAP_test>’ + ‘\n’
‘</SOAP-ENV:Body>’ + ‘\n’
‘</SOAP-ENV:Envelope>’
var poster = plugins.ttp.getposter(‘http://hereitisposted.com/SOAP/’)
poster.addHeader (‘Host’,‘http://hereitispostedto.com’)
poster.addHeader (‘User-Agent’, ‘Agent’)
poster.addHeader (‘Content-type’,‘text/xml; charset=utf-8’)
poster.addHeaeer (‘Soapaction’,‘Webservices#SOAP_test’)
httpCode = poster.doPost ();
var result = poster.getPageData();
I got the Soap response: NO XML was provided
Where is the error ?
Thank you in advance
Rainer Boehm