Solved

Bing Maps SOAP Request

Posted on 2013-01-16
7
397 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

828 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