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

RE: HTTPAPI returns a "Host name look up failed"




Rich,

I downloaded the GEOIP sample program from "
http://www.pentontech.com/IBMContent/Documents/article/56532_547_GeoIpService.zip";
 and I hope that it is the same that you use. I compiled and ran the
program with no modifications and it returned the correct country name. I
am using HTTP API V1.24beta5 and I compiled the included EXPAT from source.

I suggest to add a breakpoint to the "endElement" procedure in module
HTTPXMLR4 at the following statement:

   if (p_newval <> *null);    <== add breakpoint here
      xdealloc(p_newval);
   endif;

Once that you are there check the content of variable "element.name". These
are the values you should get:

   ReturnCode
   IP
   ReturnCodeDetails
   CountryName
   CountryCode
   GetGeoIPResult
   GetGeoIPResponse
   soap:Body
   soap:Envelope

Please also verify the content of "name" when you reach "endElement" for
the first time. In that case "element.name" should be "ReturnCode" and
"name" should be:

> EVAL name :x 32
     00000     00520065 00740075 0072006E 0043006F   - .ê.Á.È.Í.Ê.>.{.?
     00010     00640065 000000-- -------- --------   - .À.Á...Á.È./.Ñ4-

(Values beyond "000000" at offset 0014 can be ignored.)

a) If "name" equals the value as shown above but "element.name" is wrong,
something goes wrong with character translation.
b) If both values meet the expected values, something is wrong with the
"MapXmlData" procedure interface. Check the value of "root.namespace" to
determine which callback type is used.
c) If "name" does not meet the expected value, I assume that something is
wrong with your EXPAT service program.

Also ensure that HTTPAPIR4 binds to the EXPAT service program that you
think it binds to. Use "DSPSRVPGM SRVPGM(HTTPAPIR4) DETAIL(*SRVPGM)" to
check which EXPAT service is used by HTTPAPIR4.

Thomas.


ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx schrieb am 27.04.2009 23:17:25:

>
> Thomas,
>
>
>
> I don't believe so.  At least I'm not specifically making that call.
> I'm simply using the GEOIP program stock out-of-the-box and was
> assuming it would work as-is.  Is the modified procedure interface
> you mentioned supposed to replace the one currently there for the
> MapXmlData procedure?  I'm not certain what I should do here...
>
>
>
> Thanks,
>
>
>
> Rich
>
>
>
> > Subject: RE: HTTPAPI returns a "Host name look up failed"
> > To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
> > From: thomas.raddatz@xxxxxx
> > Date: Fri, 24 Apr 2009 08:26:09 +0200
> >
> >
> > Rich,
> >
> > Do you have a call to http_xmlns(*ON) in your program?. If namespaces
are
> > enabled, the procedure interface should be:
> >
> > D endElementNS PR
> > D userdata * value
> > D depth 10I 0 value
> > D ns 1024A const varying
> > D name 1024A const varying
> > D path 24576A const varying
> > D value 65535A const
> > D Attrs * const dim(32767)
> > D options(*varsize)
> >
> > Thomas.
> >
> >
> > ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx schrieb am 24.04.2009 01:50:57:
> >
> > >
> > > Hi Scott,
> > >
> > >
> > >
> > > Here's what I believe is the relevant portion of th debuge log:
> > >
> > >
> > >
> > > SetError() #13: HTTP/1.1 100 Continue
> > > senddoc(): entered
> > > <soapenv:Envelope
> > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
> > > " xmlns:web="http://www.webservicex.net";> <soapenv:Header/>
> > > <soapenv:Body> <web:GetGeoIP> <!--Optional:--> <web:IPAddress>209.
> > > 131.36.158 </web:IPAddress> </web:GetGeoIP> </soapenv:Body>
> > > </soapenv:Envelope>
> > > recvresp(): entered
> > > HTTP/1.1 200 OK
> > > Date: Wed, 22 Apr 2009 22:34:18 GMT
> > > Server: Microsoft-IIS/6.0
> > >
> > > X-Powered-By: ASP.NET
> > > X-AspNet-Version: 1.1.4322
> > > Cache-Control: private, max-age=0
> > > Content-Type: text/xml; charset=utf-8
> > > Content-Length: 521
> > >
> > > SetError() #13: HTTP/1.1 200 OK
> > > recvdoc parms: identity 521
> > > header_load_cookies() entered
> > > recvdoc(): entered
> > > SetError() #0:
> > > <?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><GetGeoIPResponse xmlns="http://www.webservicex.net
> > > "><GetGeoIPResult><ReturnCode>1</ReturnCode><IP>209.131.36.158
> > > </IP><ReturnCodeDetails>Record
> > > Found</ReturnCodeDetails><CountryName>UNITED
> > >
> >
>
STATES</CountryName><CountryCode>US</CountryCode></GetGeoIPResult></GetGeoIPResponse></soap:

> >
> > > Body></soap:Envelope>
> > > http_close(): entered
> > > New iconv() objects set, PostRem=1208. 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: S105VX7M.COM
> > > DNS server found: 68.87.85.98
> > > DNS server found: 68.87.69.146
> > > http_persist_post(): entered
> > > http_long_ParseURL(): entered
> > > do_post(): entered
> > > POST /geoipservice.asmx HTTP/1.1
> > > Host: www.webservicex.net
> > > User-Agent: http-api/1.23
> > > Content-Type: text/xml; charset=UTF-8
> > > SOAPAction: "http://www.webservicex.net/GetGeoIP";
> > > Expect: 100-continue
> > > Content-Length: 279
> > >
> > >
> > >
> > > As you can see, the country name value is "UNITED STATES". The
> > > returned XML looks ok to me, but by the time the MapXmlData
> > > Procedure gets ahold of the parsed values, it's all garbage, which
> > > is why the if construct that tests for the "name" variable to be the
> > > value 'CountryName' is never satisfied, and even if it were, the
> > > value of variable "value" is also garbage.
> > >
> > >
> > >
> > > P MapXmlData B
> > > D MapXmlData PI
> > > D country 52a varying
> > > D depth 10I 0 value
> > > D name 1024A varying const
> > > D path 24576A varying const
> > > D value 65535A varying const
> > > D attrs * dim(32767)
> > > D const options(*varsize)
> > >
> > > /free
> > > if (name = 'CountryName');
> > > country = value;
> > > endif;
> > > /end-free
> > > P E
> > >
> > >
> > > Is it possible that my EXPAT setup is incorrect, or mismatched
> > > somehow with my HTTPAPI install (ver 1.23)? I'm pretty certain I
> > > downloaded and installed the precompiled version of EXPAT (version
> > > 2.0.0 in SAVF format). I would really appreciate some help in
> > > figuring this out.
> > >
> > >
> > >
> > > Thanks,
> > >
> > >
> > >
> > > Rich
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > EMAILING FOR THE GREATER GOOD
> > > Join me
> > >
> > >
> > >
> > > > Date: Wed, 22 Apr 2009 20:36:17 -0500
> > > > From: sk@xxxxxxxxxxxxxxxx
> > > > To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
> > > > Subject: Re: HTTPAPI returns a "Host name look up failed"
> > > >
> > > > Hi Rich,
> > > >
> > > > Create a debug log (like you did before) and look at what is being
> > > > received from the web service -- the details will be in that debug
> > file.
> > > >
> > > >
> > > >
> > > > Rich Kitterman wrote:
> > > > > Hi Scott,
> > > > > > Just in case you didn't understand this: Your messages are
going to
> > > > > a
> > > > > > public mailing list. All participants on the mailing list can
read
> > > > > > them. I'm able to read your response to Michael Ryan, you don't
> > have
> > > > > to
> > > > > > repeat it.
> > > > > Thanks for the clarification. I understand that the
correspondence
> > > > > gets bounced to all on the public mailing list. I just didn't
know if
> > > > > you personally were following every piece, so as a courtesy I
> > repeated
> > > > > it.
> > > > > > Here's why I would not have suspected that: You told me that a
PING
> > > > > > worked. PING uses the same DNS resolver (configured with CFGTCP
12)
> > > > > > that HTTPAPI. Why did it work for PING and not for HTTPAPI?
> > > > > I was pinging with the same IP address I gave GEOIP as a parm. I
> > > > > think my confusion with the error message is in understanding
what
> > > > > host name was actually being looked up. Did the error have
reference
> > > > > to the target IP address I was trying to get GEOIP to return a
> > country
> > > > > name for, or was it referring to something else? I suspect the
> > > > > latter.
> > > > >
> > > > > > Hard to say. You really haven't provided any information other
than
> > > > > > "something didn't work". Check the XML that was returned from
the
> > > > > web
> > > > > > service and see if it contains the country name. If it was,
then
> > the
> > > > > > problem is in the way your interfacing to the XML parser.
> > > > > I agree. The problem is that I'm ignorant enough that I'm not
sure
> > > > > where (which HTTPAPI module or procedure) to look for the XML
string
> > > > > coming back from the web service. If you can point me in the
right
> > > > > direction, I'd be grateful. What I did determine is that when I
go to
> > > > > [1]http://www.webservicex.net/geoipservice.asmx?op=GetGeoIP and
test
> > > > > the same IP address I pass to GEOIP, the XML I get back is:
> > > > >
> > > > > <?xml version="1.0" encoding="utf-8" ?>
> > > > > - <GeoIP xmlns:xsd="[2]http://www.w3.org/2001/XMLSchema";
> > > > > xmlns:xsi="[3]http://www.w3.org/2001/XMLSchema-instance";
> > > > > xmlns="[4]http://www.webservicex.net";>
> > > > > <ReturnCode>1</ReturnCode>
> > > > > <IP>209.131.36.158</IP>
> > > > > <ReturnCodeDetails>Record Found</ReturnCodeDetails>
> > > > > <CountryName>UNITED STATES</CountryName>
> > > > > <CountryCode>US</CountryCode>
> > > > > </GeoIP>
> > > > >
> > > > > I appreciate your patience, as you can see I'm completely a
novice
> > > > > with this.
> > > >
-----------------------------------------------------------------------
> > > > 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
> > >
-----------------------------------------------------------------------
> >
> >
> > --
> > IMPORTANT NOTICE:
> > This email is confidential, may be legally privileged, and is for the
> > intended recipient only. Access, disclosure, copying, distribution, or
> > reliance on any of it by anyone else is prohibited and may be a
criminal
> > offence. Please delete if obtained in error and email confirmation
> to the sender.
> > -----------------------------------------------------------------------
> > 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
> -----------------------------------------------------------------------


--
IMPORTANT NOTICE:
This email is confidential, may be legally privileged, and is for the
intended recipient only. Access, disclosure, copying, distribution, or
reliance on any of it by anyone else is prohibited and may be a criminal
offence. Please delete if obtained in error and email confirmation to the sender.
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------