Skip to Content
avatar image
Former Member

Where to call web service best?

Hi there,

I'm using WDJ in the context of CE 7.2.

I've managed to call web services in WDJ via the adaptive web service model.

But what's not really clear to me:

Should I call the web service in the component/custom controller or should I do it in the view itself?

Is there a best practice for that?

Or does it just depend on the fact, if the data has to be available in more than one view or not?

What I've also experienced:

When you have a WS call in a component/custom controller and you add another model binding, the generated coding is messed up and you have to do some manual work to fix the problem (e.g . correct the init_* method).

Is that a bug in the service controller functionality?

Also, when I delete a model binding again, the coding of the service controller is not deleted, I've to manually delete all the generated methods (init_, execute_).

Is there a way to delete service controller coding automatically?

It seems that service controllers always remain, because when I implement the next model binding, the service controller number is increased (Service Controller *), although I've deleted all the coding in the corresponding .JAVA file.

Thanks in advance!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 15, 2011 at 10:42 AM


    Its a best practice to have your model execution in Component Controller instead of Views which adhere to MVC.



    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Nandini,

      I get your point regarding the MVC concept.

      But when I create more than one model binding to a service with the same name (e.g findAll() of a CAF business object), the newly implemented service controller always corrupts the coding and I have to adjust manually.

      Is that normal?

  • avatar image
    Former Member
    Apr 15, 2011 at 08:49 AM

    hi eddie

    I think you can use a different dc for service call instead of using custom controller or view .It is much easier and easy to understand as in your main dc you don't have to do much coding just call the method exposed in used dc.

    If there are many service calls it is good to use and easier to manage.

    Best regards


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      hi eddie

      It is always better to do yourself when you write code yourself it is less prone to mistakes

      Make a new dc (for ex model dc) ,import web service (model) in this dc,Create a method in component controller and call web service in this method,

      Expose this method and the context nodes,make the component public

      In main dc add (model dc ) in dependencies of your main dc.

      you can access the context of model dc through used DC's and also call the method where you added code for calling the service.

      Hope it works