-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Oppdrag web service client and update configurations
Added new OppdragClient class, related configuration, and corresponding consumer and controller. Adjusted build configurations and dependencies for SOAP-based web service compatibility. Replaced reactive-core with
- Loading branch information
Showing
12 changed files
with
99 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
...rag.service/config/ApplicationConfig.java → ...rag/service/config/ApplicationConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...g-service/src/main/java/no/nav/testnav/oppdrag/service/config/OppdragWsConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package no.nav.testnav.oppdrag.service.config; | ||
|
||
import no.nav.testnav.oppdrag.service.consumer.OppdragClient; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.oxm.jaxb.Jaxb2Marshaller; | ||
import org.springframework.ws.config.annotation.EnableWs; | ||
|
||
@EnableWs | ||
@Configuration | ||
public class OppdragWsConfiguration { | ||
|
||
@Bean | ||
public Jaxb2Marshaller marshaller() { | ||
Jaxb2Marshaller marshaller = new Jaxb2Marshaller(); | ||
// this package must match the package in the <generatePackage> specified in | ||
// pom.xml | ||
marshaller.setContextPath("no.nav.testnav.oppdragservice.wsdl"); | ||
return marshaller; | ||
} | ||
|
||
@Bean | ||
public OppdragClient countryClient(Jaxb2Marshaller marshaller) { | ||
|
||
var client = new OppdragClient(); | ||
client.setDefaultUri("http://localhost:8080/ws"); | ||
client.setMarshaller(marshaller); | ||
client.setUnmarshaller(marshaller); | ||
return client; | ||
} | ||
} |
File renamed without changes.
25 changes: 25 additions & 0 deletions
25
.../oppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/consumer/OppdragClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package no.nav.testnav.oppdrag.service.consumer; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.ws.client.core.support.WebServiceGatewaySupport; | ||
import org.springframework.ws.soap.client.core.SoapActionCallback; | ||
|
||
@Slf4j | ||
public class OppdragClient extends WebServiceGatewaySupport { | ||
|
||
public OppdragClient postOppdrag(String country) { | ||
|
||
// GetCountryRequest request = new GetCountryRequest(); | ||
// request.setName(country); | ||
// | ||
// log.info("Requesting location for " + country); | ||
// | ||
// GetCountryResponse response = (GetCountryResponse) getWebServiceTemplate() | ||
// .marshalSendAndReceive("http://localhost:8080/ws/countries", request, | ||
// new SoapActionCallback( | ||
// "http://spring.io/guides/gs-producing-web-service/GetCountryRequest")); | ||
// | ||
// return response; | ||
return null; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...ppdrag-service/src/main/java/no/nav/testnav/oppdrag/service/consumer/OppdragConsumer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package no.nav.testnav.oppdrag.service.consumer; | ||
|
||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class OppdragConsumer { | ||
} |
13 changes: 13 additions & 0 deletions
13
...drag-service/src/main/java/no/nav/testnav/oppdrag/service/provider/OppdragController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package no.nav.testnav.oppdrag.service.provider; | ||
|
||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping("/api/v1/oppdrag") | ||
public class OppdragController { | ||
|
||
@PostMapping | ||
public void sendOppdrag() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters