Files
gs-consuming-web-service/complete/src/main/java/hello/CountryConfiguration.java
Dave Syer f5ee891b92 Switch from public SOAP API on internet to local one
Every time we pick a public SOAP API on the internet someone shuts
it down. It's easier to just use the one from the "producing"
guide.

Fixes gh-27
2018-07-30 08:53:52 +01:00

30 lines
764 B
Java

package hello;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.oxm.jaxb.Jaxb2Marshaller;
@Configuration
public class CountryConfiguration {
@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 CountryClient countryClient(Jaxb2Marshaller marshaller) {
CountryClient client = new CountryClient();
client.setDefaultUri("http://localhost:8080/ws");
client.setMarshaller(marshaller);
client.setUnmarshaller(marshaller);
return client;
}
}