Announcement Announcement Module
Collapse
No announcement yet.
How to access beans from spring-ws-servlet.xml Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to access beans from spring-ws-servlet.xml

    Hi,
    Recently I setup a Spring Web Service. I have declared few of my own beans in spring-ws-servlet.xml. I want to retrieve them in my application. What code I will write to do so. Also, How should I retrieve ServletContext.

    Thanks,
    Madhuranjan

  • #2
    Spring makes it simple

    Hi

    It is very simple to acess beans from spring-ws-servlet.xml

    assume you have a service bean to be acessed and in your spring-ws-servlet.xml then u can configure like this

    <bean id="service" class="ServiceJavaBeanImpl">
    <description>
    This bean is our "business" service.
    </description>
    </bean>

    and in EndPoint class you need to have the below

    /**
    * Sets the "business service" to delegate to.
    */
    public void setService(IServiceJavaBean service) {
    this.service = service;
    }

    protected Element invokeInternal(Element requestElement, Document document) throws Exception {
    ----
    service.getwebservice();
    ----------------

    }

    Comment


    • #3
      How do i create a bean inside the invokeinternal other than setproperty method

      Comment

      Working...
      X