Skip to Content
0

How to Map CDS Context & Entity onto "EntitySet" for oData v4 Extension Framework

Aug 07, 2017 at 07:16 AM

91

avatar image
Former Member
<br>

Hello,

I have been trying to get a minimal connection to the oData Extension framework working, but the documentation (here) but i can't get it working. I keep getting a `501 Not Implemented` error.

i have a the following CDS

context Survey{
  Entity Question {
     QuestionTitle: String;
  }
}

and the following oData v4 Extension following the sample `ExtensionSample.java`

@ExtendDataProvider(entitySet = { "Question" }, requestTypes = RequestType.CREATE)
public void createQuestion(ExtensionContext ecx)
			throws ODataApplicationException, ExtensionException, SQLException {
		logger.debug("Entering Create Question.");
		insertQuestion(ecx);
	}

As you can see i literally just want it to catch the request. `insertQuestion` captures the connection and closes it per the example file above. (i commented out all statement preparation for now).

I then send a POST command to `<host>/java/odata/v4/snics.snicsdb._.Survey/Question`

with a body like so

{
   "QuestionTitle":"How the heck does this work?"
}

And I get

{
    "error": {
        "code": "CDSRuntimeException.NOT_IMPLEMENTED",
        "message": "'null' :Not Implemented."
    }
}

As far as I can tell, the response should hit my extension...were there any configuration steps i had to complete outside the class? I'm not getting compile errors when building either the CDS or the Service and the logs show it picks up my extension class to compile...

Thanks

10 |10000 characters needed characters left characters exceeded
Former Member

Update: We have since been able to get the general service working, though bewilderingly, without changing anything that we can detect; However we are now getting an error like 'Something unexpected happened' after it exits our extension methods. This yields an error on the front end, even though data is created....and we can't debug it because the classes are hidden.

0
* Please Login or Register to Answer, Follow or Comment.

0 Answers