huuanh1987 / facebook-java-api

Automatically exported from code.google.com/p/facebook-java-api
0 stars 0 forks source link

Application.getPublicInfo does not work #118

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
xsd schema for application_getPublicInfo_response is wrong. 

application_getPublicInfo_response contains information only about one
application, not a list of them.

version 2.0.2-shapshot

Original issue reported on code.google.com by rdmytre...@gmail.com on 14 Oct 2008 at 10:08

Attachments:

GoogleCodeExporter commented 8 years ago
This patch looks correct, the
http://wiki.developers.facebook.com/index.php/Application.getPublicInfo page
specifies that one application's info is returned, not a list.

I applied the patch to 2.0.3 and it looks fine. However, as well as the 
additions
that the patch adds to the .xsd, I'd also remove the node:
<xsd:complexType name="app_info">

This complex type is not used anywhere else in the API.

Original comment by david.j....@googlemail.com on 17 Nov 2008 at 10:39

GoogleCodeExporter commented 8 years ago
i applied the patch.. you think it's OK?  is there a unit test?

Original comment by fern...@gmail.com on 18 Nov 2008 at 4:55

GoogleCodeExporter commented 8 years ago
It's no problem. I have updated my local version and can provide a valid patch 
with
get_app_public_info test. 

Can you help me this IFacebookRestClientTest.test_dataStore and
Issue140FriendsGetJSONTest.testFriendsGetJSON? They are failure for my app.
(Should app be approved by Facebook?) 

Original comment by rdmytre...@gmail.com on 18 Nov 2008 at 9:38

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I'm going to add a better JUnit test. Some of the tests will fail without 
changing
the following method of FacebookJaxbRestClient to improve the error handling 
for JAXB:

    protected Object parseCallResult(InputStream data, IFacebookMethod method)
            throws FacebookException, IOException {
        log.debug("Facebook response:  " + rawResponse);
        Object res = getResponsePOJO();
        if (res instanceof FacebookApiException) {
            FacebookApiException error = (FacebookApiException) res;
            int errorCode = error.getErrorCode();
            String message = error.getErrorMsg();
            throw new FacebookException(errorCode, message);
        } else if (res instanceof JAXBElement) {
            JAXBElement jbe = (JAXBElement) res;
            if (FacebookApiException.class.equals(jbe.getDeclaredType())) {
                FacebookApiException error = (FacebookApiException) jbe.getValue();
                int errorCode = error.getErrorCode();
                String message = error.getErrorMsg();
                throw new FacebookException(errorCode, message);
            }
        }
        return res;
    }

Original comment by david.j....@googlemail.com on 18 Nov 2008 at 10:37

GoogleCodeExporter commented 8 years ago
I've committed the JUnit test and marked 2 of the tests with @Ignore so that the
build will work. I don't want to go committing important files like
FacebookJaxbRestClient until I have a bit more experience so I'd be grateful if 
you
could review my suggested code change and uncomment the @Ignore marked tests.

The tests will be green with the changed FacebookJaxbRestClient but I just want 
to be
sure I'm not screwing something else up by changing the error handling 
behaviour!

Original comment by david.j....@googlemail.com on 18 Nov 2008 at 10:57

GoogleCodeExporter commented 8 years ago
I think it's impossible to get FacebookApiException from jaxb. it is our own
exception class and it is not declared in facebook schema. 

Original comment by rdmytre...@gmail.com on 19 Nov 2008 at 8:52

GoogleCodeExporter commented 8 years ago

Original comment by david.j....@googlemail.com on 19 Nov 2008 at 9:22

GoogleCodeExporter commented 8 years ago
Oh... I made a mistake. You are right! I am sorry.

Original comment by rdmytre...@gmail.com on 19 Nov 2008 at 9:35

GoogleCodeExporter commented 8 years ago
i committed that change, it looks ok.

anything else you want to do for this issue?

Original comment by fern...@gmail.com on 19 Nov 2008 at 6:28

GoogleCodeExporter commented 8 years ago
JUnit test passes. Thanks. Issue marked as fixed.

Original comment by david.j....@googlemail.com on 20 Nov 2008 at 9:54