Solved

Bing Maps SOAP Request

Posted on 2013-01-16
7
395 Views
Last Modified: 2013-01-16
What namespace do I need for GeocodeService.GeocodeRequest please.
0
Comment
Question by:Dodsworth
  • 4
  • 3
7 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 38782488
0
 
LVL 42

Expert Comment

by:sedgwick
ID: 38782493
you can find the list of  Maps SOAP Services here:
Bing Maps SOAP Services Addresses
0
 
LVL 1

Author Comment

by:Dodsworth
ID: 38782570
Ah maybe not SOAP then ?

The sample code I have makes no reference to this.

The GeocodeService.GeocodeRequest errors as not defined so I assumed it was simply a case of adding the appropriate Imports?

   Private Sub MakeGeocodeRequest()

        Dim Results As String
        Try
            ' Set a Bing Maps key before making a request
            Dim key = "Bing Maps Key"

            Dim geocodeRequest As New GeocodeService.GeocodeRequest()

            ' Set the credentials using a valid Bing Maps Key
            geocodeRequest.Credentials = _
            New GeocodeService.Credentials() With {.ApplicationId = key}

            ' Set the full address query
            geocodeRequest.Query = "1 Microsoft Way, Redmond, WA"

            ' Set the options to only return high confidence results
            Dim filters() As GeocodeService.ConfidenceFilter = _
            {New GeocodeService.ConfidenceFilter() _
            With {.MinimumConfidence = GeocodeService.Confidence.High}}

            Dim geocodeOptions As New GeocodeService.GeocodeOptions() _
            With {.Filters = filters}

            geocodeRequest.Options = geocodeOptions

            ' Make the geocode request
            Dim geocodeServiceInstance As New GeocodeService.GeocodeServiceClient("BasicHttpBinding_IGeocodeService")
            Dim geocodeResponse = geocodeServiceInstance.Geocode(geocodeRequest)

            ' Use the results in your application.
            Results = geocodeResponse.Results(0).DisplayName

        Catch ex As Exception
            Results = "An exception occurred: " & ex.Message

        End Try

    End Sub

Open in new window

0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 42

Expert Comment

by:sedgwick
ID: 38782577
why not using the soap service if you need it?
i assume you use visual studio so add the service reference and run your code.
0
 
LVL 1

Author Comment

by:Dodsworth
ID: 38782842
OK never used a service reference before.  Is the namespace section in the dialog related to the name GeocodeService in the code?
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 38782855
screenshotyes, once you add the service reference, you would be able to use:
Dim geocodeRequest As New GeocodeService.GeocodeRequest()
0
 
LVL 1

Author Closing Comment

by:Dodsworth
ID: 38782913
cools :)
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Disable extension 8 38
VB: Convert 2 dates to specific format 24 48
VB.Net - Get ColumnNames of SQL Table 4 13
Help with adding DLL file in Windows project 20 31
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question