• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 422
  • Last Modified:

Bing Maps SOAP Request

What namespace do I need for GeocodeService.GeocodeRequest please.
0
Dodsworth
Asked:
Dodsworth
  • 4
  • 3
1 Solution
 
Meir RivkinFull stack Software EngineerCommented:
0
 
Meir RivkinFull stack Software EngineerCommented:
you can find the list of  Maps SOAP Services here:
Bing Maps SOAP Services Addresses
0
 
DodsworthAuthor Commented:
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Meir RivkinFull stack Software EngineerCommented:
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
 
DodsworthAuthor Commented:
OK never used a service reference before.  Is the namespace section in the dialog related to the name GeocodeService in the code?
0
 
Meir RivkinFull stack Software EngineerCommented:
screenshotyes, once you add the service reference, you would be able to use:
Dim geocodeRequest As New GeocodeService.GeocodeRequest()
0
 
DodsworthAuthor Commented:
cools :)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now