0

I use RAD 8.5 build in web-service feature to create web services and run in websohere 8.It's no need third-party web services framework ,no set up in web.xml . now I need integrate it with spring . I use load application context in my web services construction .I know it clumsy . who has the elegant solution to integrate spring with it . Thanks . My code is below .

import javax.jws.WebService;
@WebService(
        name = "Test",
        targetNamespace = "http:///www.test.com",
        serviceName = "TestService",
        portName = "TestPort"

        )
public class TestWebservice {
    ApplicationContext context = new ClassPathXmlApplicationContext(
            "classpath*:**/applicationContext*.xml")

    public String sayHi(String inputStr){


        return "Hi " +  context.getbean("Testbao").sayHi( inputStr) ;

    } 
}
pnuts
  • 58,317
  • 11
  • 87
  • 139
Psy Jia
  • 61
  • 3
  • So are you running without a `web.xml` for your application? – Ryan Ransford Mar 18 '14 at 17:41
  • the web.xml is very normal , no serverlet ,no listener information. I suppose websphere just use jws annotation to detect web services. – Psy Jia Mar 19 '14 at 13:32
  • now I put org.springframework.web.context.ContextLoaderListener in the web.xml , now I found 12:11:35:282 EDT] 00000017 WASAxis2Exten I WSWS7037I: The /TestService URL pattern was configured for the TestWebservice servlet located in the testwebs.war web module. was loaded first before spring loaded into web application . It 's possible load it after spring loaded first – Psy Jia Mar 19 '14 at 17:36

0 Answers0