[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: duplicate calls to web service



Hi Kim,

HTTP consists of two parts:
1) Send Request.
2) Receive Response.

Your logs show that you are successfully doing sending the request, but 
you are not receiving a response.  HTTPAPI is trying to receive it, but 
it's receiving nothing from the server, and eventually timing out.

That means that neither your StartOfElement() nor your EndOfElement() 
handler is being called.  I'm not sure where 'embfile' is coming from, 
but my guess would be that you're creating it in the EndOfElement() 
routine.  So if that routine is never called, 'embfile' won't exist.

Your program does not end when http_url_post_xml() returns an error... 
it keeps going, and calls http_parse_xml_stmf().  When that routine is 
called, there is no embfile, so it returns 'No such path or directory.' 
  (as it should.)

You need to find out why the server isn't sending you a response!  Why 
is it timing out?

also, one suggestion for you:   if http_url_post_xml() fails, you might 
want to abort the rest of the routine.  After all, if it failed, you 
didn't get an XML file.  Why proceed to try to parse it?


On 2/11/2011 2:51 PM, Kim Gibson wrote:
>
>     Here is the debug file content, after installing the newest beta
>     version of HTTPAPI. I am no longer making duplicate calls, but I am
>     getting the error "SetError() #22: open(): No such path or directory."
>
>
>     I'm posting the debug file here, including my comments, to see if I
>     can understand this process. My comments are enclosed with ":::". My
>     code follows the debug file.
>
>
>     HTTPAPI Ver 1.24beta11 released 2010-09-09
>
>     OS/400 Ver V6R1M0
>
>
>     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: mycompany.com
>
>     DNS server found: 192.168.30.9
>
>     DNS server found: 207.170.210.162
>
>     DNS server found: 168.215.210.50
>
>     https_init(): entered
>
>     ----------------------------------------------------------------------
>     ---------------
>
>     Dump of local-side certificate information:
>
>     ----------------------------------------------------------------------
>     ---------------
>
>     ----------------------------------------------------------------------
>     ---------------
>
>     Dump of server-side certificate information:
>
>     ----------------------------------------------------------------------
>     ---------------
>
>     Cert Validation Code = 0
>
>     -----BEGIN CERTIFICATE-----
>
>     :::removed certificate info:::
>
>     -----END CERTIFICATE-----
>
>     Serial Number: 03:C3:ED:21:80:79:0E:5B:8D:1B:42:91:12:2C:B6:79
>
>     Common Name: ws.labone.com
>
>     Country: US
>
>     State/Province: New Jersey
>
>     Locality: Teterboro
>
>     Org Unit: Quest Diagnostics, Incorporated
>
>     Org: Corp IT - renwws01
>
>     Issuer Org: VeriSign Trust Network
>
>     Issuer Org Unit: www.verisign.com/CPS Incorp.by Ref. LIABILITY
>     LTD.(c)97 VeriSign, OU=VeriSign International Server CA - Class 3,
>     OU=VeriSign, Inc.
>
>     Version: 03
>
>     not before: 20101005180000
>
>     not after: 20111006175959
>
>     pub key alg: 1.2.840.113549.1.1.5
>
>
>     Protocol Used: TLS Version 1
>
>     http_persist_post(): entered
>
>     http_long_ParseURL(): entered
>
>     do_oper(POST): entered
>
>     POST /services/eoservice.asmx HTTP/1.1
>
>     Host: ws.labone.com
>
>     User-Agent: http-api/1.24
>
>     Content-Type: text/xml
>
>     Content-Length: 2352
>
>
>     senddoc(): entered  :::has the request been sent at this point?:::
>
>
>     :::removed xml request:::
>
>     recvresp(): entered
>
>     SetError() #43: CommSSL_Read:  time-out!  :::reading through previous
>     posts, it sounds like this is a normal error:::
>
>     recvresp(): end with timeout  ::: Response wasn't received,
>     apparently? Because of the CommSSL Read: time-out?:::
>
>     http_close(): entered
>
>     ::: does the fact that this line is repeating mean that the process is
>     starting over again? à::: HTTPAPI Ver 1.24beta11 released 2010-09-09
>
>     OS/400 Ver V6R1M0
>
>
>     :::Here is the open() error. What is this pertaining to? The temporary
>     file that is to hold the response? (see embfile in code below):::
>     SetError() #22: open(): No such path or directory.
>
>
>
>     Here is my code:
>
>
>         // ----------------------------------------------
>
>             //  Send request to server, and get response
>
>             // ----------------------------------------------
>
>
>                embfile = http_tempfile();
>
>
>                  rc = 0;
>
>
>                  // LabOne Web Service -
>
>                  // test address:
>     https://wssim.labone.com/services/eoservice.asmx
>
>                  // live address:
>     https://ws.labone.com/services/eoservice.asmx
>
>
>                  rc = http_url_post_xml(
>
>                      'https://ws.labone.com/services/eoservice.asmx'
>
>                            : %addr(SOAP)+2
>
>                            : %len(SOAP)
>
>                            : %paddr(StartOfElement)
>
>                            : %paddr(EndOfElement)
>
>                            : *NULL
>
>                            : HTTP_TIMEOUT);
>
>
>                 if (rc<>  1);
>
>                   rStatus = 'F';  // F = Failure
>
>                   rError = http_error;
>
>                 else;
>
>                   rStatus = 'S';  // S = Success
>
>                   rError = *blanks;
>
>                 endif;
>
>
>
>              http_XmlReturnPtr(*OFF);
>
>
>
>              // ----------------------------------------------
>
>             //    Parse the second XML document (the one
>
>             //    that was embedded)
>
>             // ----------------------------------------------
>
>               resp = *allx'00';
>
>               if (http_parse_xml_stmf( embfile
>
>                                      : HTTP_XML_CALC
>
>                                      : *null
>
>                                      : %paddr(Embedded)
>
>                                      : %addr(resp) )<  0);
>
>                   unlink(embfile);
>
>                   rError = http_error;
>
>                   rStatus = 'F';  //F = Fail;
>
>                   //http_crash();
>
>               else;
>
>
>                 head = 1;
>
>                 exsr printRequest;
>
>                 rStatus = 'S';  //S = Success;
>
>                 rError = *blanks;
>
>
>               endif;
>
>
>           /if defined(DEBUGGING)
>
>               if rStatus = 'S';
>
>                 exsr printData;
>
>               endif;
>
>           /endif
>
>
>               return;
>
>
>
>
>     Thanks for your ideas and feedback!
>
>
>     Kim Gibson
>
>
>
>
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------