Grazie.
Il 12 febbraio 2020 alle 0.22 Scott Klement <sk@xxxxxxxxxxxxxxxx> ha scritto:
Hello,
Your "tem" namespace is wrong... or, at least, it doesn't match what I get if I run your WSDL through SoapUI. Your program has this:
xmlns:tem="http://www.tempuri.org/">+
It should be:
xmlns:tem="http://tempuri.org/">+
It seems that you added the "www" (I don't know why?) and therefore the site you're connecting to doesn't recognize the "Add", "intA" or "intB" tags because you're telling it that they're from a different specification than the one it is looking for.
This is not related to HTTPAPI -- its simply how XML works. If you add the extra "www" in SoapUI, you'll get the exact same results.
-SK
On 2/11/2020 11:25 AM, max.ino@xxxxxxxxx wrote:
--Hi, all.
I made my first program to consume a WS.
I want to add two numbers 10 and 15
With SOAPUI I get the right result (25) while with my program I get zero
This is MY program:
http_debug(*ON);
URL = '';
http_setOption('SoapAction': ' "http://tempuri.org/Add"');
SOAP =
'<soapenv:Envelope +
xmlns:soapenv= "http://schemas.xmlsoap.org/soap/envelope/" +
xmlns:tem= "http://www.tempuri.org/">+
<soapenv:Header/>+
<soapenv:Body>+
<tem:Add>+
<tem:intA>10</tem:intA>+
<tem:intB>15</tem:intB>+
</tem:Add>+
</soapenv:Body>+
</soapenv:Envelope>';
response = http_string( 'POST': URL: SOAP: 'text/xml');
xml-into rate %xml(response: 'case=ay ns=remove +
path=Envelope/Body/AddResponse/AddResult');
http_comp('Risultato:'+%char(rate));
*inlr = *on;
This is the debug file:
HTTPAPI Ver 1.40 released 2019-08-15
NTLM Ver 1.4.0 released 2014-12-22
OS/400 Ver V6R1M0
http_persist_open(): entered
http_long_ParseURL(): entered
DNS resolver retrans: 2
DNS resolver retry : 2
DNS resolver options: x'00000136'
DNS default domain: cassaedilepg.it
DNS server found: 10.0.0.101
DNS server found: 10.0.0.102
Nagle's algorithm (TCP_NODELAY) disabled.
http_persist_req(POST) entered.
http_long_ParseURL(): entered
http_long_ParseURL(): entered
do_oper(POST): entered
There are 0 cookies in the cache
POST /calculator.asmx HTTP/1.1
Host: www.dneonline.com
User-Agent: http-api/1.39
Content-Type: text/xml
SOAPAction: "http://tempuri.org/Add"
Content-Length: 242
senddoc(): entered
<soapenv:Envelope xmlns:soapenv= "http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem= "http://www.tempuri.org/"><soapenv:Header/><soapenv:Body><tem:Add><tem:intA>10</tem:intA><tem:intB>15</tem:intB></tem:Add></soapenv:Body></soapenv:Envelope>
recvresp(): entered
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Length: 325
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Tue, 11 Feb 2020 16:39:05 GMT
SetError() £13: HTTP/1.1 200 OK
recvresp(): end with 200
recvdoc parms: identity 325
header_load_cookies() entered
recvdoc(): entered
SetError() £0:
recvdoc(): Receiving 325 bytes.
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap= "http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd= "http://www.w3.org/2001/XMLSchema"><soap:Body><AddResponse xmlns= "http://tempuri.org/"><AddResult>0</AddResult></AddResponse></soap:Body></soap:Envelope>
http_close(): entered
What am I doing wrong?
Thanks
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi
-- _______________________________________________ Ftpapi mailing list Ftpapi@xxxxxxxxxxxxxxxxxxxxxx http://scottklement.com/mailman/listinfo/ftpapi