Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Calling custom DMI DSRequest from Servlet

    Hello,

    Using: (SC_SNAPSHOT-2012-02-27_v8.2p/PowerEdition Deployment 2012-02-27)

    I have a normal Servlet, and from this servlet I want to do an 'add' DSRequest. The operationBinding of this request is shown below. It however, does not call the DMI-add method of the specified className. Instead, it executes as if there was no <serverObject> specified (this datasource is a mysql DS btw).

    Is this supposed to work like this? If so, how can I make sure my DMI method is called?
    Code:
    <operationBinding operationType="add" requiresAuthentication="false" requiresRole="" operationId="Order_JsonWebserviceDataSourceImplDefaultAddOperation"> 
          <serverObject className="nl.sytematic.projects.MyProject.server.custom.dmi.Order_CustomDMI"/>  
    </operationBinding>
    I am calling it like so:

    Code:
    protected void doPost(HttpServletRequest request,
    			HttpServletResponse response) throws ServletException, IOException {
       try {
    	DSRequest req = new DSRequest("Order_", "add");
            //init it with some values, omitted
            //...
            // run the Add request
            req.setOperationId("Order_JsonWebserviceDataSourceImplDefaultAddOperation");
    	req.setValues(values);
    	DSResponse resp;
    
    	try {
    	    resp = req.execute();
    	} catch (Exception e) {
    	    //*snip*
    	}
       }
       catch (ServiceException e) {
    	//*snip*
        }
    }
    Should I somehow start an RPC Manager first? Help or hints are appreciated!
    Last edited by Sytematic; 8 May 2012, 06:58.

    #2
    No need for an RPCManager..

    Have you checked whether this operationBinding is working normally when called through IDACall? Maybe it's just a problem like not putting <operationBinding> within <operationBindings>.

    Comment


      #3
      Darn, it was something like that indeed. Thanks!

      Comment

      Working...
      X