Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Fri, 14 Sep 2007 09:26:09 -0700,    group: microsoft.public.mappoint.webservice        back       


RE: HTTP 401 Error Accessing MapPoint WebServices using code   
Lily,

Can you please post your credentials so I can test them out and verify?  
Also the full piece of code would help a lot including your web.config file 
or wherever your credentials reside.

Thanks,
-- 
Infusion Development
http://www.infusiondev.com


"Lily" wrote:

> I tested the credentials and they tested 
> fine.
> But when use them in my application i get HTTP 401. Please help. I am using 
> the following code.
> 
> NetworkCredential myCredentials = new NetworkCredential(myUserID, myPassword);
>  FindServiceSoap findService = new FindServiceSoap();
>  findService.Credentials = myCredentials;
>   findService.PreAuthenticate = true;
> FindAddressSpecification locationData = new FindAddressSpecification();
>     locationData.DataSourceName = myDataSourceName;
>      locationData.InputAddress = mapAddress;
>         
>    findResults = findService.FindAddress(locationData);   -- this is where i 
> get the error
>
date: Fri, 14 Sep 2007 09:26:09 -0700   author:   Derek Chan

RE: HTTP 401 Error Accessing MapPoint WebServices using code   
Here are my Credentials which i am using in my Web.config.

<add key="MPUser" value="128534" />
<add key="MPPass" value="QW!123op" />

Here is the code.

 //Step 1
            FindServiceSoap findService = new FindServiceSoap();
            MapPointService.Address myAddress = new MapPointService.Address();
            FindAddressSpecification findAddressSpec =
                                 new FindAddressSpecification();

            //Step 2
            myUserID = ConfigurationManager.AppSettings.Get("MPUser");
            myPassword = ConfigurationManager.AppSettings.Get("MPPass");

            findService.Credentials =
              new System.Net.NetworkCredential(myUserID, myPassword);
            findService.PreAuthenticate = true;

            //Step 3
            myAddress.AddressLine = "1 Healthsouth Pkwy";
            myAddress.PrimaryCity = "Birmingham";
            myAddress.PostalCode = "35243";
            myAddress.CountryRegion = "US";

            //Step 4
            findAddressSpec.DataSourceName = "MapPoint.NA";
            findAddressSpec.InputAddress = myAddress;

            //Step 5
            findResults = findService.FindAddress(findAddressSpec);
      for(int i=0;i<=findResults.Results.Length;i++){

                Console.Out.Write(findResults.Results[i]);
                }
                LatLong latlong = new LatLong();
                latlong = findResults.Results[0].FoundLocation.LatLong;

                ret = new 
MapCoordinate(float.Parse(latlong.Latitude.ToString()), 
float.Parse(latlong.Longitude.ToString()));
     return ret;
        }

Appreciate your help.



"Derek Chan" wrote:

> Lily,
> 
> Can you please post your credentials so I can test them out and verify?  
> Also the full piece of code would help a lot including your web.config file 
> or wherever your credentials reside.
> 
> Thanks,
> -- 
> Infusion Development
> http://www.infusiondev.com
> 
> 
> "Lily" wrote:
> 
> > I tested the credentials and they tested 
> > fine.
> > But when use them in my application i get HTTP 401. Please help. I am using 
> > the following code.
> > 
> > NetworkCredential myCredentials = new NetworkCredential(myUserID, myPassword);
> >  FindServiceSoap findService = new FindServiceSoap();
> >  findService.Credentials = myCredentials;
> >   findService.PreAuthenticate = true;
> > FindAddressSpecification locationData = new FindAddressSpecification();
> >     locationData.DataSourceName = myDataSourceName;
> >      locationData.InputAddress = mapAddress;
> >         
> >    findResults = findService.FindAddress(locationData);   -- this is where i 
> > get the error
> >
date: Mon, 17 Sep 2007 06:30:20 -0700   author:   Lily

RE: HTTP 401 Error Accessing MapPoint WebServices using code   
Lily,

Are you behind a proxy?  I tried your credentials out and they work fine for 
me.

Regards,
-- 
Infusion Development
http://www.infusiondev.com


"Lily" wrote:

> Here are my Credentials which i am using in my Web.config.
> 
> <add key="MPUser" value="128534" />
> <add key="MPPass" value="QW!123op" />
> 
> Here is the code.
> 
>  //Step 1
>             FindServiceSoap findService = new FindServiceSoap();
>             MapPointService.Address myAddress = new MapPointService.Address();
>             FindAddressSpecification findAddressSpec =
>                                  new FindAddressSpecification();
> 
>             //Step 2
>             myUserID = ConfigurationManager.AppSettings.Get("MPUser");
>             myPassword = ConfigurationManager.AppSettings.Get("MPPass");
> 
>             findService.Credentials =
>               new System.Net.NetworkCredential(myUserID, myPassword);
>             findService.PreAuthenticate = true;
> 
>             //Step 3
>             myAddress.AddressLine = "1 Healthsouth Pkwy";
>             myAddress.PrimaryCity = "Birmingham";
>             myAddress.PostalCode = "35243";
>             myAddress.CountryRegion = "US";
> 
>             //Step 4
>             findAddressSpec.DataSourceName = "MapPoint.NA";
>             findAddressSpec.InputAddress = myAddress;
> 
>             //Step 5
>             findResults = findService.FindAddress(findAddressSpec);
>       for(int i=0;i<=findResults.Results.Length;i++){
> 
>                 Console.Out.Write(findResults.Results[i]);
>                 }
>                 LatLong latlong = new LatLong();
>                 latlong = findResults.Results[0].FoundLocation.LatLong;
> 
>                 ret = new 
> MapCoordinate(float.Parse(latlong.Latitude.ToString()), 
> float.Parse(latlong.Longitude.ToString()));
>      return ret;
>         }
> 
> Appreciate your help.
> 
> 
> 
> "Derek Chan" wrote:
> 
> > Lily,
> > 
> > Can you please post your credentials so I can test them out and verify?  
> > Also the full piece of code would help a lot including your web.config file 
> > or wherever your credentials reside.
> > 
> > Thanks,
> > -- 
> > Infusion Development
> > http://www.infusiondev.com
> > 
> > 
> > "Lily" wrote:
> > 
> > > I tested the credentials and they tested 
> > > fine.
> > > But when use them in my application i get HTTP 401. Please help. I am using 
> > > the following code.
> > > 
> > > NetworkCredential myCredentials = new NetworkCredential(myUserID, myPassword);
> > >  FindServiceSoap findService = new FindServiceSoap();
> > >  findService.Credentials = myCredentials;
> > >   findService.PreAuthenticate = true;
> > > FindAddressSpecification locationData = new FindAddressSpecification();
> > >     locationData.DataSourceName = myDataSourceName;
> > >      locationData.InputAddress = mapAddress;
> > >         
> > >    findResults = findService.FindAddress(locationData);   -- this is where i 
> > > get the error
> > >
date: Wed, 19 Sep 2007 08:04:04 -0700   author:   Derek Chan

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us