Switch to quote service (SOAP endpoint actually exists)
The weather service we had been using no longer exists and there doesn't seem to be a simple publicly available alternative (everyone is using plain HTTP these days). So this change converts the sample to a public SOAP service that does stock quotes. Fixes gh-9
This commit is contained in:
29
complete/src/main/java/hello/QuoteConfiguration.java
Normal file
29
complete/src/main/java/hello/QuoteConfiguration.java
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
package hello;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.oxm.jaxb.Jaxb2Marshaller;
|
||||
|
||||
@Configuration
|
||||
public class QuoteConfiguration {
|
||||
|
||||
@Bean
|
||||
public Jaxb2Marshaller marshaller() {
|
||||
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
|
||||
// this package must match the package in the <generatePackage> specified in
|
||||
// pom.xml
|
||||
marshaller.setContextPath("hello.wsdl");
|
||||
return marshaller;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public QuoteClient quoteClient(Jaxb2Marshaller marshaller) {
|
||||
QuoteClient client = new QuoteClient();
|
||||
client.setDefaultUri("http://www.webservicex.com/stockquote.asmx");
|
||||
client.setMarshaller(marshaller);
|
||||
client.setUnmarshaller(marshaller);
|
||||
return client;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user