Solved

Bing Maps SOAP Request

Posted on 2013-01-16
7
390 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now