Skip to content

Commit

Permalink
Test SOAP 1.2 with custom content type
Browse files Browse the repository at this point in the history
  • Loading branch information
ppalaga committed Dec 22, 2024
1 parent 36b7dc7 commit 91eb162
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,14 @@ quarkus.cxf.client.soap12.logging.enabled = true

quarkus.cxf.client.contentType.client-endpoint-url = http://localhost:${quarkus.http.test-port}/soap/soap12
quarkus.cxf.client.contentType.service-interface = io.quarkiverse.cxf.it.HelloService
#quarkus.cxf.client.contentType.soap-binding = http://www.w3.org/2003/05/soap/bindings/HTTP/
quarkus.cxf.client.contentType.content-type = application/soap+xml; action="contentTypeAction"
quarkus.cxf.client.contentType.content-type = application/soap+xml; action="helloAction"; foo=bar
quarkus.cxf.client.contentType.logging.enabled = true

quarkus.cxf.client.contentTypeSoap12.client-endpoint-url = http://localhost:${quarkus.http.test-port}/soap/soap12
quarkus.cxf.client.contentTypeSoap12.soap-binding = http://www.w3.org/2003/05/soap/bindings/HTTP/
quarkus.cxf.client.contentTypeSoap12.content-type = application/soap+xml; action="helloAction"; foo=bar
quarkus.cxf.client.contentTypeSoap12.logging.enabled = true

quarkus.cxf.endpoint."/soap12".implementor = io.quarkiverse.cxf.it.soap12.Soap12HelloServiceImpl
quarkus.cxf.endpoint."/soap12".soap-binding = http://www.w3.org/2003/05/soap/bindings/HTTP/
quarkus.cxf.endpoint."/soap12".logging.enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public class Soap12Rest {
@CXFClient("contentType")
HelloService contentType;

@CXFClient("contentTypeSoap12")
HelloService contentTypeSoap12;

HelloService getClient(String clientName) {
switch (clientName) {
case "soap12": {
Expand All @@ -26,6 +29,9 @@ HelloService getClient(String clientName) {
case "contentType": {
return contentType;
}
case "contentTypeSoap12": {
return contentTypeSoap12;
}
default:
throw new IllegalArgumentException("Unexpected client name: " + clientName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,14 @@ quarkus.cxf.client.soap12.logging.enabled = true

quarkus.cxf.client.contentType.client-endpoint-url = http://localhost:${quarkus.http.test-port}/soap/soap12
quarkus.cxf.client.contentType.service-interface = io.quarkiverse.cxf.it.HelloService
#quarkus.cxf.client.contentType.soap-binding = http://www.w3.org/2003/05/soap/bindings/HTTP/
quarkus.cxf.client.contentType.content-type = application/soap+xml; action="contentTypeAction"
quarkus.cxf.client.contentType.content-type = application/soap+xml; action="helloAction"; foo=bar
quarkus.cxf.client.contentType.logging.enabled = true

quarkus.cxf.client.contentTypeSoap12.client-endpoint-url = http://localhost:${quarkus.http.test-port}/soap/soap12
quarkus.cxf.client.contentTypeSoap12.soap-binding = http://www.w3.org/2003/05/soap/bindings/HTTP/
quarkus.cxf.client.contentTypeSoap12.content-type = application/soap+xml; action="helloAction"; foo=bar
quarkus.cxf.client.contentTypeSoap12.logging.enabled = true

quarkus.cxf.endpoint."/soap12".implementor = io.quarkiverse.cxf.it.soap12.Soap12HelloServiceImpl
quarkus.cxf.endpoint."/soap12".soap-binding = http://www.w3.org/2003/05/soap/bindings/HTTP/
quarkus.cxf.endpoint."/soap12".logging.enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,18 @@ void contentType() {
.then()
.statusCode(200)
.body(Matchers
.is("Hello Joe, Content-Type: application/soap+xml; action=\"contentTypeAction\"; charset=UTF-8"));
.is("Hello Joe, Content-Type: application/soap+xml; action=\"helloAction\"; foo=bar; charset=UTF-8"));
}

@Test
void contentTypeSoap12() {
RestAssured.given()
.body("Joe")
.post("/Soap12Rest/sync/contentTypeSoap12")
.then()
.statusCode(200)
.body(Matchers
.is("Hello Joe, Content-Type: application/soap+xml; action=\"helloAction\"; foo=bar; charset=UTF-8"));
}

}

0 comments on commit 91eb162

Please sign in to comment.