How to make an @WebService spring aware

后端 未结 3 392
长情又很酷
长情又很酷 2020-12-08 23:58

I have a Web Service which I am trying to Autowire a variable into. Here is the class:

package com.xetius.isales.pr7.service;

import java.util.Arrays;
impo         


        
相关标签:
3条回答
  • 2020-12-09 00:33

    Depending on container version or even the Spring, hereinafter you will have an easy solution to expose your WSDL, use:

    @PostConstruct
    SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
    
    0 讨论(0)
  • 2020-12-09 00:45

    If you want autowiring to happen, ProductRulesWebService needs to extend SpringBeanAutowiringSupport

    Extending that class will allow UpgradeController to be autowired

    0 讨论(0)
  • 2020-12-09 00:56

    Use a stack like CXF, which supports Spring natively, then you can essentially do something like this:

    <bean id="aService" class="com.xetius.isales.pr7.service.ProductRulesWebService " />
    
    <jaxws:endpoint id="aServiceEndpoint" implementor="#aService" address="/aService" />
    
    0 讨论(0)
提交回复
热议问题