Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make an @WebService spring aware
    primarykey
    data
    text
    <p>I have a Web Service which I am trying to Autowire a variable into. Here is the class:</p> <pre><code>package com.xetius.isales.pr7.service; import java.util.Arrays; import java.util.List; import javax.jws.WebService; import org.springframework.beans.factory.annotation.Autowired; import com.xetius.isales.pr7.domain.PR7Product; import com.xetius.isales.pr7.domain.PR7Upgrade; import com.xetius.isales.pr7.logic.UpgradeControllerInterface; @WebService(serviceName="ProductRulesService", portName="ProductRulesPort", endpointInterface="com.xetius.isales.pr7.service.ProductRulesWebService", targetNamespace="http://pr7.isales.xetius.com") public class ProductRulesWebService implements ProductRulesWebServiceInterface { @Autowired private UpgradeControllerInterface upgradeController; @Override public List&lt;PR7Product&gt; getProducts() { if (upgradeController == null) { return Arrays.asList(new PR7Product("Fail")); } return upgradeController.getProducts(); } @Override public List&lt;PR7Upgrade&gt; getUpgrades() { if (upgradeController == null) { return Arrays.asList(new PR7Upgrade("Fail")); } return upgradeController.getUpgrades(); } @Override public List&lt;PR7Product&gt; getProductsForUpgradeWithName(String upgradeName) { if (upgradeController == null) { return Arrays.asList(new PR7Product("Fail")); } return getProductsForUpgradeWithName(upgradeName); } } </code></pre> <p>However, when I try to access the web service I am getting the Fail version returned, meaning that upgradeController is not being autowired. Here is my applicationContext:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt; &lt;context:component-scan base-package="com.xetius.isales.pr7" /&gt; &lt;context:annotation-config /&gt; &lt;bean id="upgradeController" class="com.xetius.isales.pr7.logic.UpgradeController" /&gt; &lt;/beans&gt; </code></pre> <p>How do I make it so that the @WebService class is spring aware and autowiring happens</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload