| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx

spring @WebService 注解

1
Java HTML Spring C/C++ Go 21986 次浏览

 spring @WebService 注解
Spring框架介绍
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; 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<PR7Product> getProducts() { 
        if (upgradeController == null) { 
            return Arrays.asList(new PR7Product("Fail")); 
        } 
        return upgradeController.getProducts(); 
    } 
 
    @Override 
    public List<PR7Upgrade> getUpgrades() { 
        if (upgradeController == null) { 
            return Arrays.asList(new PR7Upgrade("Fail")); 
        } 
        return upgradeController.getUpgrades(); 
    } 
 
    @Override 
    public List<PR7Product> getProductsForUpgradeWithName(String upgradeName) { 
        if (upgradeController == null) { 
            return Arrays.asList(new PR7Product("Fail")); 
        } 
        return getProductsForUpgradeWithName(upgradeName); 
    } 
 } 

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:

<?xml version="1.0" encoding="UTF-8"?> <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"> 
    <context:component-scan base-package="com.xetius.isales.pr7" /> 
    <context:annotation-config /> 
 
    <bean id="upgradeController" class="com.xetius.isales.pr7.logic.UpgradeController" /> 
 </beans> 

How do I make it so that the @WebService class is spring aware and autowiring happens

http://luju.me/spring/reference/overview.html

6个答案

0

ดาวน์โหลดjoker123 auto Online slots, mobile phones, new online slots games, online slots that are the hottest in 2020, with low capital, can play.​​

0

ทางเข้า joker123 Top camp slots games Genuine license from PGSLOT game camp, online slots, direct web slot game service.​​

0

joker  PG SLOT Game is a new and hot slot game that is gaining popularity right now, online slots, direct websites, not through agents.

0

เว็บตรง สล็อต PG SLOT online slots games A game that is popular with players all over the world right now. Your slots play will never be boring again.​​

0
0

If you do not know which acoustic guitar to get for beginners then I would suggest you to check the essayshark review. This review is written by experts who have used it.