GMan
GMan

Reputation: 119

Getting 500 error in Bluemix Address cleansing api (data works)

I have just gone through the address cleansing api link in devops-- https://hub.jazz.net/project/dataworks/address-cleansing/overview and followed the steps.

Finally This steps ends with "https://YourAppName.mybluemix.net" app creation in bluemix.

Now i simply opened the "https://YourAppName.mybluemix.net" link and giving the values in text boxes as follows

"state": "NY", "Address Line 1": "1 New Orchrd St", "city": "Armonk" or "state": "MA", "Address Line 1": "550 King St", "city": "Littleton".

-Now hit the cleanse button,

it throws an error -- Unable to cleanse address.

Also in console i am getting -- *Failed to load resource: the server responded with a status of 500 https://YourAppName.mybluemix.net/dataworks/addresscleansing*

What would be the issue? I have followed the same steps 3months back, it was working fine. But now it throws this error. Any help?

Upvotes: 0

Views: 111

Answers (2)

Dhamu
Dhamu

Reputation: 11

The problem seems to be with JSON Object Type used in the Sample code. As such DataWorks service is working properly. Situation can be resolved by replacing "JSONObject" by "String" in file \address-cleansing\src\com\ibm\dataworks\sample\addresscleansing\AddressCleansingResource.java

Original code:

    public Response cleanseAddress(JSONObject addressesInput) {
    ...
    StringEntity input = new StringEntity(addressesInput.serialize());

Replace by:

    public Response cleanseAddress(String addressesInput) {
    ...
    StringEntity input = new StringEntity(addressesInput);

Upvotes: 0

rspoglia
rspoglia

Reputation: 414

Error 500 could mean a temporary problem with the responding server. Anyway if you still see the problem please open a ticket to Bluemix support sending along the entire logs.

Upvotes: 1

Related Questions