•   over 6 years ago

Subscribing to Data Custodian, weird response

Ok i made the following request to the Data Custodian but im not sure what I should see as the response.

Request:
-------------------------------------------------------------------------
POST /ldc/api/v1/Subscription HTTP/1.1
X-HostCommonName:
greenbutton.affsys.com
Authorization:
Bearer id-d569952e-e71b-47c9-874c-3d8be8997ebe
Host:
greenbutton.affsys.com
Content-Length:
25
X-Target-URI:
https://greenbutton.affsys.com
Content-Type:
application/x-www-form-urlencoded; charset=UTF-8
Connection:
Keep-Alive

frequency=daily&type=data
-------------------------------------------------------------------------

Response:

-------------------------------------------------------------------------
HTTP/1.1 200 OK
Date:
Sat, 09 Nov 2013 21:15:08 GMT
Content-Length:
0
Server:
Apache-Coyote/1.1
-------------------------------------------------------------------------

  • 14 comments

  •   •   over 6 years ago

    Can someone respond to this? According to the documentation I should get a subscription ID however all i see is a 200 OK but no data in the response. I have had this problem before due to invalid parameters or content type issues however I have tried everything and nothing seems to be working.

  •   •   over 6 years ago

    Hello. A potential issue is currently being investigated. We will update you on this as soon as possible.

  •   •   over 6 years ago

    Here is another trace I am getting when I do a POST with the customer's access token.
    JBoss Web/7.0.13.Final - Error report<!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--> HTTP Status 500 - type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.jboss.resteasy.spi.UnhandledException: java.lang.NullPointerException
    org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:156)
    org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:174)
    org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
    org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
    org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    com.google.inject.servlet.DefaultFilterPipeline.dispatch(DefaultFilterPipeline.java:43)
    com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
    root cause java.lang.NullPointerException
    ca.on.gov.energy.ldc.api.interceptors.AuditResponseBodyInterceptor.aroundWriteTo(AuditResponseBodyInterceptor.java:63)
    org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:119)
    org.jboss.resteasy.plugins.providers.jackson.JacksonJsonpInterceptor.aroundWriteTo(JacksonJsonpInterceptor.java:113)
    org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:119)
    org.jboss.resteasy.plugins.interceptors.encoding.GZIPEncodingInterceptor.aroundWriteTo(GZIPEncodingInterceptor.java:100)
    org.jboss.resteasy.core.interception.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:119)
    org.jboss.resteasy.core.ServerResponseWriter.writeNomapResponse(ServerResponseWriter.java:111)
    org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:152)
    org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:174)
    org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
    org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
    org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    com.google.inject.servlet.DefaultFilterPipeline.dispatch(DefaultFilterPipeline.java:43)
    com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
    note The full stack trace of the root cause is available in the JBoss Web/7.0.13.Final logs. JBoss Web/7.0.13.Final

  •   •   over 6 years ago

    I didn't use subscription but
    Authorization:
    Bearer id-d569952e-e71b-47c9-874c-3d8be8997ebe
    doesn't seem like valid access token.

  •   •   over 6 years ago

    are you ok now or still having problems?

  •   •   over 6 years ago

    was the error above is respect of a CreateSubscription call? What parameters are you specifying in the call?

    Upon success you should receive a response that provides the subscription id which is included as an ATOM link within the XML body. For example:

    .

  •   •   over 6 years ago

    link href="/Subscription/1" rel="self"

  •   •   over 6 years ago

    Yes so the very first post i made, i was using the incorrect Authorization parameter. I am now using the customer's access_token however it is still returning that 500 error above.

    Yes this is the "Create Subscription" call. I find it very strange that were doing a POST request yet according to the document, it has parameters in the URL?

    https://greenbutton.affsys.com/ldc/api/v1/Subscription?frequency=daily&type=

    I am using apigee to do my testing, here is a link to the exact request and responses.

    https://snap.apigee.com/178nZBC

  •   •   over 6 years ago

    Also, dunno if it helps but i have updated my app to "A subscription request to receive EUI data as per a requested schedule" instead of "Ongoing requests on a scheduled basis and data stored for ongoing analysis".

    yshteinm, can you please provide me with a sample request you are making that works so i can compare it to mine? Thanks

  •   •   over 6 years ago

    As I said I am doing mobile app and it cannot use Subscription. If I have time I will simulate that request on PC and let you know. BTW, just to let you know I am not part of support team :-)

  •   •   over 6 years ago

    Here is the problem. I updated my Public App for Public company to profile "A subscription request to receive EUI data as per a requested schedule". When I go to Authorize that app in Setup Application Access I see Resource Profile as "Add hoc request and one time use". This is wrong. I am not sure but if you have such profile you probably cannot subscribe. This seems like bug in portal as I cannot change that.

  •   •   over 6 years ago

    So, we have 2 problems:
    1. It seems that you cannot change resource profile (for example from add hoc to subscription) after an app was created and authorized first time. See my previous comment in this thread.
    2. Something is broken in third app portal as now I cannot authorize any application at all. I created a new thread for that

  •   •   over 6 years ago

    Yes, we do have these two issues currently with the Test Lab. We will keep you updated as they are resolved.

  •   •   over 6 years ago

    Has this been resolved? I'm seeing the stack trace with the NullPointerException. No XML response with the subscription ID as expected.

Comments are closed.