I have a plugin that use Geocode web service of bing maps to retrieve data.
This is how i set my client:
BasicHttpBinding bindingBing = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
GeocodeServiceClient geocodeService = new GeocodeServiceClient(bindingBing, new EndpointAddress("https://dev.virtualearth.net/webservices/v1/geocodeservice/geocodeservice.svc"));
geocodeService.InnerChannel.OperationTimeout = new TimeSpan(0, 0, 30);
GeocodeResponse geocodeResponse = geocodeService.Geocode(geocodeRequest);
I need to NOT do the geocodeReponse if the service is unavaible or my bing maps key is invalid. Right now, it trys to make the request and fails everytime. I dont know what i missing between my client and my response. Any help?
You need to specify credentials. Here is an example:
GeocodeRequest geocodeRequest = new GeocodeRequest();
// Set the credentials using a valid Bing Maps key
geocodeRequest.Credentials = new GeocodeService.Credentials();
geocodeRequest.Credentials.ApplicationId = key;
That said, you may have noticed that the documentation for the Bing Maps SOAP services is no longer online. I would take this as a hint. I stopped recommending the Bing Maps SOAP services when the REST services were released 5 years ago. The REST services are faster, have more features, and has a smaller response size which means less bandwidth usage. There REST services should always be used instead of the SOAP services. You can find documentation on the Bing Maps REST services here: http://msdn.microsoft.com/en-us/library/ff701713.aspx There is also information in there on how to use them in .NET.
Related
I have a rest application that pulls data from database based on the user choice of City or County via UI.
The city, and county are dynamically passed in as the user is able to choose all 50 states.
The endpoints are like this:
http://localhost:8080/my-api/state/FL/City
http://localhost:8080/my-api/state/FL/County
http://localhost:8080/my-api/state/CA/City
http://localhost:8080/my-api/state/AK/County
etc...etc....
Now I want to secure these endpoints using Apigee along with a key. I have created the proxy and product and able to get json from application with my new Apigee URL:
https://company.api-nonprod.com/my-first-api/state/TX/City?apikey=ldekQ5VqlXFQq7YusetSeqbeidxdo5
So far so good. :)
Now I need to add this EndPoint to the front end configuration file.
My local endpoint worked fine.
http://localhost:8080/my-api/state
How do I add this new Apigee Endpoint and key?
This doesn't work as it keeps appending the parameters to the end of url instead of before the apikey.
https://company.api-nonprod.com/my-first-api/state?apikey=ldekQ5VqlXFQq7YusetSeqbeidxdo5
error url
https://company.api-nonprod.com/my-first-api/state?apikey=ldekQ5VqlXFQq7YusetSeqbeidxdo5/TX/City
After going over the Apigee documentation I made my way to the Develop tab in which I can specify how the APIKey can be referenced.
<VerifyAPIKey name="APIKeyVerifier">
<APIKey ref="request.formparam.x-apikey"/>
</VerifyAPIKey>
<VerifyAPIKey name="APIKeyVerifier">
<APIKey ref="request.header.x-apikey"/>
</VerifyAPIKey>
<VerifyAPIKey name="APIKeyVerifier">
<APIKey ref="request.queryparam.x-apikey"/>
</VerifyAPIKey>
Now I'm stuck in AssignMessage message documentation.
How do I pass dynamic values to Apigee with key?
You have to handle constructing URL in your application.
Try to hit from postman.. have your proxy url and your requestMapping appened with your proxy url.
it should work, or it would have worked by this time ;) , since two months gone :P
Im using this URL http://maps.googleapis.com/maps/api/geocode/json?address="ADDRESS"&sensor=false?key=APIKey of our prjct. But not getting results. It shows me error eventhough I use an API Key
{
"error_message" : "Keyless access to Google Maps Platform is deprecated. Please use an API key with all your API calls to avoid service interruption. For further details please refer to http://g.co/dev/maps-no-account",
"results" : [],
"status" : "OVER_QUERY_LIMIT"
}
Unable to understand where am I going wrong. Any help would be highly appreciated
I believe http://maps.googleapis.com/maps/api/geocode/json?address="ADDRESS"&sensor=false?key=APIKey is wrong.
Have a look at this part ?key=APIKey, it should be &key=APIKey. Also note that address parameter shouldn't have " symbols and sensor parameter is not required anymore, it was deprecated long time ago.
The request should be
https://maps.googleapis.com/maps/api/geocode/json?address=ADDRESS&key=APIKey
I hope this helps!
it's clearly says,
"Keyless access to Google Maps Platform"
to use Google API's you need to register the application, and request API services.
therefore you will have an
access to your key to use, keep in mind all the API services requires Client Key and you have to provide it in the Request otherwise you can't use any of google API's.
you can generate Key after Registering here
I want to get the values of all custom fields for a particular JIRA issue using SOAP API. I have a custom field named 'Phase' having value Decision Pending for a JIRA issue JIRA-123.
I am using JIRA 5.1.3.
I am able to get all the properties of JIRA issue using SOAP API except the value of the custom field for above issue.
I tried following code, but I am not able to use ComponentManager in my code
IssueManager issueManager = ComponentManager.getInstance().getIssueManager();
CustomFieldManager customFieldManager = ComponentManager.getInstance().getCustomFieldManager();
Issue issue = issueManager.getIssueObject("JIRA-123");
CustomField customField = customFieldManager.getCustomFieldObjectByName("Phase");
Object customFieldValue = issue.getCustomFieldValue(customField);
I would highly appreciate if anyone can provide correct approach.
The SOAP API is deprecated by 5.1.3. I suggest you use the REST API - it is both more easy to use and implement.
What is REST?: read here. The basic idea is to bind HTTP request types to actions, it's quite obvious - check this table for a quick run-in.
Jira has a powerful REST API that you can use. This is the main documentation of the current release.
What do you need to do in some high-level steps?:
Set-Up some type of authentication with your JIRA instance. Be it:
Baisc - example
OAuth - example
Get a list of all fields via the API:
The /rest/api/2/field' [method returns a list of all fields][6] - both System and Custom.
Then when you identify the exact field use/rest/api/2/customFieldOption/{id}` to get the full
representation of the Custom Field Option.
I recommend you use a tools like Chrome REST Console ,or anything similar that you can easily make requests with, to get to know the API. The bonus is that you don't need to setUp authentication if you're logged in through the same browser. Your user will require full admin access though.
This is the root of all JIRA REST API docs. Check it out.
If you're doing this in PHP I would personally recommend using some kind of library. I've used
Guzzle (in a CakePHP environment) for this exact task and it turned out very well.
I'm not sure of how do you use the soap API, here is example of using it via the PHP-SOAP:
#!/usr/bin/php -q
<?php
$soapClient = new SoapClient("https://jira.com/rpc/soap/jirasoapservice-v2?wsdl");
$token = $soapClient->login('user', 'password');
$myIssue = $soapClient->getIssue($token,"TES-13");
print_r($myIssue); // all of the issue details
print_r($myIssue->customFieldValues); // get all custom fields
foreach ($myIssue->customFieldValues as $customFieldValue) {
// search for the right custom field
if ($customFieldValue->customfieldId == 'customfield_10402') {
echo $customFieldValue->values[0];
die();
}
}
?>
In case you want to use any other API, have a look at the JIRA Remote API Reference.
A remark regarding the REST and SOAP APIs -To quote from Jira's site the SOAP API "Supported but no future development". The Rest API is still a bit new and there are things you can't yet do with the REST API (example), and can be done easily using the SOAP API.
Hi I am using a bing maps 7.0 ajax api to display map. I have several addresses which i geocode to get latitude and longitude using rest services in javascript. I have setup up a GeocodeCallback method in the geocode request.
geocodeRequest = "http://dev.virtualearth.net/REST/v1/Locations?"+mapDataAddress[1]+"&output=json&jsonp=GeocodeCallback&jsonso="+mapDataAddress[0]+"&key="+credentials;
CallRestService(geocodeRequest);
When the address are found i get a response in my GeocodeCallback function but for few address i dont get a response. How to figure out this status and error.
I figured this out. So basically you need to do two things.
You need to change your URL structure. I have found out that sometimes if I have weird address, bing will return a 400.
use the suppressStatus parameter and set it to true. I can't find the docs at this moment but basically I have found that if bing returns a 400,404,etc it won't actually call the callBack function. So supressstatus says that no matter what, always return a 200.
Orignially you have:
http://dev.virtualearth.net/REST/v1/Locations?"+mapDataAddress[1]+"&output=json&jsonp=GeocodeCallback&jsonso="+mapDataAddress[0]+"&key="+credentials;
So you want to do this:
http://dev.virtualearth.net/REST/v1/Locations?addressLine="+mapDataAddress[1]+"&output=json&jsonp=GeocodeCallback&suppressStatus=true&jsonso="+mapDataAddress[0]+"&key="+credentials;
Also take a look at the Tips and Tricks for using the Bing Maps REST services listed here: http://www.bing.com/blogs/site_blogs/b/maps/archive/2013/02/14/bing-maps-rest-service-tips-amp-tricks.aspx
i am using Bing map tiles in my Android application. I download tiles from http://h0.ortho.tiles.virtualearth.net/tiles/h<quadkey>.jpeg?g=131 and it works fine, but i understand that i need to append a token to this URL in order to make this operation legal (and ask some kind of special permission from Microsoft). It is all well explained here: http://blogs.msdn.com/b/virtualearth/archive/2008/04/29/tracking-virtual-earth-tile-usage.aspx. But this post is from 2008 and i found on msdn site that in 2012, token-auth system will be replaced with key auth system.
Does anybody know how can i perform the direct tile access with this new auth system?
Thanks in advance
Accessing tiles directly with key-based authentication can be accomplished like so:
Using the REST ‘Get Imagery Metadata’ service to obtain the tile URL format for the type of tiles you wish to display:
http://msdn.microsoft.com/en-us/library/ff701716.aspx
- For example, if you wish to display Road tiles, the following request could be used (taken from the above documentation): http://dev.virtualearth.net/REST/V1/Imagery/Metadata/Road?mapVersion=v1&output=xml&key=BingMapsKey
Within the response, the URL for tiles is returned, with a placeholder for the tile quadkey.
A new REST request should be issued each time the map viewer in the application is instantiated, or whenever the map type is changed (eg. You wish to switch to aerial or hybrid map style)
Your platform usage can then be tracked based on the calls to the REST service.