Unespected response
Posted: Wed Nov 24, 2021 9:38 am
Hi everybody,
I can't get a valid response from a machine equipped with a soap interface to my IBM i.
The HTTPAPI version is 1.38 dated 2017-10-09
The OS version is 7.2
The request with the utility SOAPUI works fine, here's the expected response.
I wrote a simple program to test it.
Here's the log i get.
I can't get a valid response from a machine equipped with a soap interface to my IBM i.
The HTTPAPI version is 1.38 dated 2017-10-09
The OS version is 7.2
The request with the utility SOAPUI works fine, here's the expected response.
Code: Select all
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<LeggiResponse xmlns="http://tempuri.org/">
<LeggiResult xmlns:a="http://schemas.datacontract.org/2004/07/RusconiELineWS" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:ContatoreTot2>2343</a:ContatoreTot2>
<a:HMI_CaricoTotaleUSSS>7950</a:HMI_CaricoTotaleUSSS>
<a:HMI_Ticket_in_lavorazione/>
<a:HMI_USSS_LOWER_Average>60.8333321</a:HMI_USSS_LOWER_Average>
<a:HMI_USSS_UPPER_Average>236.306656</a:HMI_USSS_UPPER_Average>
<a:ImpNumCicli>1</a:ImpNumCicli>
<a:PassoImpostatoUTAS>855</a:PassoImpostatoUTAS>
<a:QtaBusteProdotte>0</a:QtaBusteProdotte>
<a:RiscSInfTmpDesiderata>30</a:RiscSInfTmpDesiderata>
<a:RiscSSupTmpDesiderata>230</a:RiscSSupTmpDesiderata>
<a:SetPointUSSS>8000</a:SetPointUSSS>
<a:TempoSaldaturaUSSS>0.8</a:TempoSaldaturaUSSS>
<a:TempoTrainoAnt>0.7</a:TempoTrainoAnt>
</LeggiResult>
</LeggiResponse>
</s:Body>
</s:Envelope>
Code: Select all
ctl-opt DECEDIT('0,')
datedit(*dmy) datfmt(*iso)
option(*nodebugio) bnddir('HTTPAPI');
//
DCL-S url VARCHAR(100);
DCL-S soap VARCHAR(1000);
DCL-S response VARCHAR(100000);
/copy httpapi_h
http_debug(*On:'/tmp/mydebuglog.txt');
//
http_setOption('SoapAction': '"GetValue"');
//
url = 'http://192.168.15.41:8733/+
Design_Time_Addresses/RusconiELineWS/Service1/';
soap = '<?xml version="1.0" encoding="utf-8"?> +
<soapenv:Envelope +
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" +
xmlns:tem="http://tempuri.org/"> +
<soapenv:Header/> +
<soapenv:Body> +
<tem:Leggi/> +
</soapenv:Body> +
</soapenv:Envelope>';
//
response = http_string( 'GET' : url : SOAP : 'text/xml');
*inlr = *on;
RETURN;
Code: Select all
HTTPAPI Ver 1.38 released 2017-10-09
NTLM Ver 1.4.0 released 2014-12-22
OS/400 Ver V7R2M0
New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0
http_persist_open(): entered
http_long_ParseURL(): entered
DNS resolver retrans: 2
DNS resolver retry : 2
DNS resolver options: x'00000136'
DNS default domain: EURONDA.COM
DNS server found: 192.168.1.11
DNS server found: 192.168.1.12
Nagle's algorithm (TCP_NODELAY) disabled.
http_persist_req(GET) entered.
http_long_ParseURL(): entered
http_long_ParseURL(): entered
do_oper(GET): entered
There are 0 cookies in the cache
GET /Design_Time_Addresses/RusconiELineWS/Service1/ HTTP/1.1
Host: 192.168.15.41:8733
User-Agent: http-api/1.38
Content-Type: text/xml
SOAPAction: "GetValue"
Content-Length: 230
senddoc(): entered
<?xml version="1.0" encoding="utf-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> <soapenv:Header/> <soapenv:Body> <tem:Leggi/> </soapenv:Body> </soapenv:Envelope>
recvresp(): entered
HTTP/1.1 200 OK
Content-Length: 3163
Content-Type: text/html; charset=UTF-8
Server: Microsoft-HTTPAPI/2.0
Date: Tue, 23 Nov 2021 10:29:03 GMT
SetError() £13: HTTP/1.1 200 OK
recvresp(): end with 200
recvdoc parms: identity 3163
header_load_cookies() entered
recvdoc(): entered
SetError() £0:
recvdoc(): Receiving 3163 bytes.
<HTML lang="en"><HEAD><link rel="alternate" type="text/xml" href="http://localhost:8733/Design_Time_Addresses/RusconiELineWS/Service1/?disco"/><STYLE type="text/css">#content{ FONT-SIZE: 0.7em; PADDING-BOTTOM: 2em; MARGIN-LEFT: 30px}BODY{MARGIN-TOP: 0px; MARGIN-LEFT: 0px; COLOR: #000000; FONT-FAMILY: Verdana; BACKGROUND-COLOR: white}P{MARGIN-TOP: 0px; MARGIN-BOTTOM: 12px; COLOR: #000000; FONT-FAMILY: Verdana}PRE{BORDER-RIGHT: #f0f0e0 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #f0f0e0 1px solid; MARGIN-TOP: -5px; PADDING-LEFT: 5px; FONT-SIZE: 1.2em; PADDING-BOTTOM: 5px; BORDER-LEFT: #f0f0e0 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #f0f0e0 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e5e5cc}.heading1{MARGIN-TOP: 0px; PADDING-LEFT: 15px; FONT-WEIGHT: normal; FONT-SIZE: 26px; MARGIN-BOTTOM: 0px; PADDING-BOTTOM: 3px; MARGIN-LEFT: -30px; WIDTH: 100%; COLOR: #ffffff; PADDING-TOP: 10px; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #003366}.intro{display: block; font-size: 1em;}</STYLE><TITLE>Service1 Service</TITLE></HEAD><BODY><DIV id="content" role="main"><h1 class="heading1">Service1 Service</h1><BR/><P class="intro">You have created a service.<P class='intro'>To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:</P> <BR/><PRE>svcutil.exe <A HREF="http://localhost:8733/Design_Time_Addresses/RusconiELineWS/Service1/?wsdl">http://localhost:8733/Design_Time_Addresses/RusconiELineWS/Service1/?wsdl</A></PRE><P>You can also access the service description as a single file:<BR/><PRE><A HREF="http://localhost:8733/Design_Time_Addresses/RusconiELineWS/Service1/?singleWsdl">http://localhost:8733/Design_Time_Addresses/RusconiELineWS/Service1/?singleWsdl</A></PRE></P></P><P class="intro">This will generate a configuration file and a code file that contains the client class. Add the two files to your client application and use the generated client class to call the Service. For example:<BR/></P><h2 class='intro'>C#</h2><br /><PRE><font color="blue">class </font><font color="black">Test
</font>{
<font color="blue"> static void </font>Main()
{
<font color="black">Service1Client</font> client = <font color="blue">new </font><font color="black">Service1Client</font>();
<font color="darkgreen"> // Use the 'client' variable to call operations on the service.
</font><font color="darkgreen"> // Always close the client.
</font> client.Close();
}
}
</PRE><BR/><h2 class='intro'>Visual Basic</h2><br /><PRE><font color="blue">Class </font><font color="black">Test
</font><font color="blue"> Shared Sub </font>Main()
<font color="blue"> Dim </font>client As <font color="black">Service1Client</font> = <font color="blue">New </font><font color="black">Service1Client</font>()
<font color="darkgreen"> ' Use the 'client' variable to call operations on the service.
</font><font color="darkgreen"> ' Always close the client.
</font> client.Close()
<font color="blue"> End Sub
</font><font color="blue">End Class</font></PRE></DIV></BODY></HTML>
http_close(): entered