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

GEOIP web service - This page requires a user-id & password



   Good morning,

   I'm new to the world of web services and am working my way through
   Scott's example using the geoipservice.asmx example.

   I'm getting the error "This page requires a user-id & password"
   instead of the country name ( I used IP = 66.111.97.6).

   It works fine using the soapUI 2.0.2 program, but I'm having trouble
   with the RPG version.

   Thank you for your assistance.


        H dftactgrp(*no) bnddir('HTTPAPI')


         /copy HTTPAPI_H


        D GEOIP           PR                  Extpgm('GEOIP')

        D   IPADDR                      15A   const

        D GEOIP           PI

        D   IPADDR                      15A   const


        D MapXMLData      PR

        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)


        D VaryingDataOffset...

        D                 C                   const(2)

        D SOAP            S           1024A   Varying

        D CountryName     S             50A   Varying

        D Wait            S              1A

        D Rc              S             10i 0


         /Free

           If %parms < 1;

              http_comp('Usage:  CALL GEOIP PARM(''xxx.xxx.xxx.xxx'')');

              return;

           Endif;


           SOAP = '<soapenv:Envelop +


   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; +

                     xmlns:web="http://www.webservicex.net";>  +

                     <soapenv:Header/> +

                     <soapenv:Body>  +

                        <web:GetGeoIP> +

                           <!--Optional:--> +

                           <web:IPAddress>' + IPADDR + '</web:IPAddress>
   +

                        </web:GetGeoIP>     +

                     </soapenv:Body>        +

                  </soapenv:Envelope>';


           http_setccsids(1208: 0);

           http_debug(*ON);


           rc = http_post_xml(
   'http://www.webservicex.net/geoipservice.asmx'

                             : %addr(SOAP) + VARYINGDATAOFFSET

                             : %len(SOAP)

                             : *Null

                             : %Paddr(MapXMLData)

                             : %Addr(CountryName)

                             : HTTP_TimeOut

                             : Http_UserAgent

                             : 'text/xml; charset=UTF-8'

                             : '"http://www.webservicex.net/GetGeoIP";' );


           If (rc <> 1);

              http_crash();

           Endif;


           Dsply CountryName ' ' wait;

           *INLR = *On;

         /End-Free


        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




   SetError() #13: HTTP/1.1 401 Unauthorized

   recvdoc parms: identity 0

   interpret_auth(): entered

   SetError() #36: This page requires a user-id & password

   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: COUNTY.com

   DNS server found: 10.20.1.23

   DNS server found: 10.20.1.10

   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: 291



   recvresp(): entered

   SetError() #43: CommTCP_read: No 100-Continue (error ignored)

   senddoc(): entered

   <soapenv:Envelop
   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
   xmlns:web="http://www.webservicex.net";>  <soapenv:Header/>
   <soapenv:Body>  <web:GetGeoIP> <!--Optional:-->
   <web:IPAddress>66.111.97.6    </web:IPAddress> </web:GetGeoIP>
   </soapenv:Body>        </soapenv:Envelope>

   recvresp(): entered

   HTTP/1.1 401 Unauthorized

   WWW-Authenticate: Basic realm="HTTP Authentication (ID43814)"

   Connection: close



   SetError() #13: HTTP/1.1 401 Unauthorized

   recvdoc parms: identity 0

   interpret_auth(): entered

   SetError() #36: This page requires a user-id & password

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