Hi I tried to invoke a SpringWS same way as new realease as WebServiceDemo.Would apprecaite help.
GidSI.java
SI.xmlCode:public static void main(String[] args) { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("SI.xml", GidSI.class); String requestXml = "<hr:CompanyRequest xmlns:hr=\"http://mycompany.com/hr/schemas\">" + "<hr:Company>"+ "<hr:CompanyName>TestRequest</hr:CompanyName>"+ "</hr:Company>"+ "</hr:CompanyRequest>"; Message<String> message = MessageBuilder.withPayload(requestXml) .setHeader(AbstractWebServiceOutboundGateway.SOAP_ACTION_PROPERTY_KEY, "http://mycompany.com/hr/schemas") .build(); ((MessageChannel) context.getBean("sendChannel")).send(message); }
Error messageCode:<message-bus/> <channel id="sendChannel"/> <ws:outbound-gateway id="simpleGateway" request-channel="sendChannel" reply-channel="receiveChannel" uri="http://localhost:8080/Trial1/companyservice"/> <beans:bean id="simpleGateway" class="org.springframework.integration.ws.SimpleWebServiceOutboundGateway"> <beans:constructor-arg index="0" value="http://localhost:8080/Trial1/companyservice"/> </beans:bean> <stream:stdout-channel-adapter id="receiveChannel"/> </beans:beans>
Code:Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.ws.SimpleWebServiceOutboundGateway#0': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.integration.ws.SimpleWebServiceOutboundGateway]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:254) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:197) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:172) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:158) at org.springframework.integration.rc.GidSI.main(GidSI.java:16) Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.integration.ws.SimpleWebServiceOutboundGateway]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:248) ... 18 more Caused by: java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357) at java.lang.Class.getConstructor0(Class.java:2671) at java.lang.Class.getDeclaredConstructor(Class.java:1953) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:78) at org.springframework.ws.support.DefaultStrategiesHelper.instantiateBean(DefaultStrategiesHelper.java:133) at org.springframework.ws.support.DefaultStrategiesHelper.getDefaultStrategies(DefaultStrategiesHelper.java:115) at org.springframework.ws.support.DefaultStrategiesHelper.getDefaultStrategy(DefaultStrategiesHelper.java:200) at org.springframework.ws.support.DefaultStrategiesHelper.getDefaultStrategy(DefaultStrategiesHelper.java:184) at org.springframework.ws.client.core.WebServiceTemplate.initMessageFactory(WebServiceTemplate.java:314) at org.springframework.ws.client.core.WebServiceTemplate.initDefaultStrategies(WebServiceTemplate.java:303) at org.springframework.ws.client.core.WebServiceTemplate.<init>(WebServiceTemplate.java:133) at org.springframework.integration.ws.AbstractWebServiceOutboundGateway.<init>(AbstractWebServiceOutboundGateway.java:54) at org.springframework.integration.ws.SimpleWebServiceOutboundGateway.<init>(SimpleWebServiceOutboundGateway.java:56) at org.springframework.integration.ws.SimpleWebServiceOutboundGateway.<init>(SimpleWebServiceOutboundGateway.java:52) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100) ... 20 more


Reply With Quote