Server 500 error when GETting data from an Business via REST - Forum - Mobile - Progress Community

Server 500 error when GETting data from an Business via REST

 Forum

Server 500 error when GETting data from an Business via REST

  • I see your point. One more try however.

    I'm trying to call:

    @openapi.openedge.export(type="REST", useReturnValue="false", writeDataSetBeforeImage="false").
    @progress.service.resourceMapping(type="REST", operation="read", URI="?filter=~{filter~}", alias="", mediaType="application/json").
    method public void ReadSysUserRBE(filter as character, output dataset dsuser):

    Just a basic READ method (of the CRUD methods).

    if I take a look in the mapping.xml in the staging dir however I see no corresponding mapping for the filter parameter:

    <mapping:MappingBean id="mapping" xmlns:mapping="http://www.progress.com/caf/mapping1.0">
    <![CDATA[<mapping:messageMapping xmlns:conditional="http://www.progress.com/caf/mapping1.0/conditional" xmlns:mapping="http://www.progress.com/caf/mapping1.0">
    <mapping:mapInput/>
    <mapping:mapOutput>
    <conditional:conditionalRuleSet>
    <conditional:if condition="${(rest.resourcename == 'SysUserRBE') and (rest.operationname == 'bfv.system.SysUserRBE..ReadSysUserRBE') and (rest.verb == 'GET')}">
    <mapping:rule source="${idl.param['dsuser']}" target="${http.body}"/>
    </conditional:if>
    </conditional:conditionalRuleSet>
    </mapping:mapOutput>
    </mapping:messageMapping>]]>
    </mapping:MappingBean>

    Is this correct or should there be a mapping for the filter (input) parameter as well? The stack is trying to tell something about parameters. 

     

     

  • Yes, the generated mapping is the correct one.
     
    Mapping XML won't generate the mapping, if parameter name are similar (in Paramater and Request section as below screen shot) i.e. CustID.
    The mappings rules are implicitly executed by Runtime.

     
    If parameters names are differ or if we map to http body, tooling will generate the mapping in the mapping.xml file.
     
    Hope it helpful!
     
    Regards,
    Ganesh
     
    From: bfvo [mailto:bounce-bfvo@community.progress.com]
    Sent: Wednesday, January 22, 2014 7:07 PM
    To: TU.Mobile@community.progress.com
    Subject: RE: Server 500 error when GETting data from an Business via REST
     
    RE: Server 500 error when GETting data from an Business via REST
    Reply by bfvo

    I see your point. One more try however.

    I'm trying to call:

    @openapi.openedge.export(type="REST", useReturnValue="false", writeDataSetBeforeImage="false").
    @progress.service.resourceMapping(type="REST", operation="read", URI="?filter=~{filter~}", alias="", mediaType="application/json").
    method public void ReadSysUserRBE(filter as character, output dataset dsuser):

    Just a basic READ method (of the CRUD methods).

    if I take a look in the mapping.xml in the staging dir however I see no corresponding mapping for the filter parameter:

    <mapping:MappingBean id="mapping" xmlns:mapping="http://www.progress.com/caf/mapping1.0">
    <![CDATA[<mapping:messageMapping xmlns:conditional="http://www.progress.com/caf/mapping1.0/conditional" xmlns:mapping="http://www.progress.com/caf/mapping1.0">
    <mapping:mapInput/>
    <mapping:mapOutput>
    <conditional:conditionalRuleSet>
    <conditional:if condition="${(rest.resourcename == 'SysUserRBE') and (rest.operationname == 'bfv.system.SysUserRBE..ReadSysUserRBE') and (rest.verb == 'GET')}">
    <mapping:rule source="${idl.param['dsuser']}" target="${http.body}"/>
    </conditional:if>
    </conditional:conditionalRuleSet>
    </mapping:mapOutput>
    </mapping:messageMapping>]]>
    </mapping:MappingBean>

    Is this correct or should there be a mapping for the filter (input) parameter as well? The stack is trying to tell something about parameters. 

     

     

    Stop receiving emails on this subject.

    Flag this post as spam/abuse.

  • It turned out that the restoe file wasn't generated and therefor not present in the .paar file. It's a project setting in the build section. Question is why this isn't turned on by default when you start a REST or Mobile project. A more informative exception would help as well.

  • Could you please share the project.
     
    From: bfvo [mailto:bounce-bfvo@community.progress.com]
    Sent: Thursday, February 06, 2014 2:00 AM
    To: TU.Mobile@community.progress.com
    Subject: RE: Server 500 error when GETting data from an Business via REST
     
    Reply by bfvo

    It turned out that the restoe file wasn't generated and therefor not present in the .paar file. It's a project setting in the build section. Question is why this isn't turned on by default when you start a REST or Mobile project. A more informative exception would help as well.

    Stop receiving emails on this subject.

    Flag this post as spam/abuse.

  • Are you referring to the "Generate REST invocation files" option in Project Properties -> Progress OpenEdge -> Build ? If not, can you please provide the specific option in question ?

  • (deleted user) : yes, that was what I was refering to. Somehow the default is "off" when creating a new mobile (or REST) project.

    BTW, Sorry for the late reply, I don't receive notifications that a new message has been written in the thread (I believe that feature was turned off)

  • With respect to:

    > I don't receive notifications that a new message has been written in the thread (I believe that feature was turned off)

    I get emails now as do many others. I believe it was originally turned on automatically for everyone, but many members of the Community felt that this was too much like spam.

    The email feature is now operating but you need to "opt in". If you go to the Individual Forums you should see

    EMAIL INFORMATION
    Email this forum
    Subscribed: Yes=
  • OK thanks, but it's quite common in fora to get notifications only for the threads you took part in.

  • That's strange, it is indeed off by default, but so far I have had no issues with a missing .restoe in my generated .paar files. If it was a common issue I would have expected to see this problem more often, but so far you are the 2nd person that I know of who reported this issue. Thanks for confirming the solution though, it's something for us to look into.

  • Some extra info: I've seen the original error on 3 different machines (2 laptops, 1 VM). It happened with both 11.3.1 & 11.3.2.

    If I may suggest: I think some more time needs to be spent on exception handling. This error, but also when for example when the AppServer is not running, could be handled with clear & descriptive messages in the log file, insetad of not so obvious stack traces / nested exceptions. This would make the life of both developer and techsupport easier.

    Anyway, case closed. Thanks for thinking along with me.