generated from quarkiverse/quarkiverse-template
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
109 additions
and
1 deletion.
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
23 changes: 23 additions & 0 deletions
23
...ests/client-server/src/main/java/io/quarkiverse/cxf/it/soap12/Soap12HelloServiceImpl.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,23 @@ | ||
package io.quarkiverse.cxf.it.soap12; | ||
|
||
import jakarta.annotation.Resource; | ||
import jakarta.jws.WebService; | ||
import jakarta.servlet.http.HttpServletRequest; | ||
import jakarta.xml.ws.WebServiceContext; | ||
import jakarta.xml.ws.handler.MessageContext; | ||
|
||
import io.quarkiverse.cxf.it.HelloService; | ||
|
||
@WebService(serviceName = "HelloService", targetNamespace = HelloService.NS) | ||
public class Soap12HelloServiceImpl implements HelloService { | ||
|
||
@Resource | ||
WebServiceContext wsContext; | ||
|
||
@Override | ||
public String hello(String person) { | ||
final HttpServletRequest req = (HttpServletRequest) wsContext.getMessageContext().get(MessageContext.SERVLET_REQUEST); | ||
return "Hello " + person + ", Content-Type: " + req.getHeader("Content-Type"); | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
integration-tests/client-server/src/main/java/io/quarkiverse/cxf/it/soap12/Soap12Rest.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,35 @@ | ||
package io.quarkiverse.cxf.it.soap12; | ||
|
||
import jakarta.ws.rs.POST; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.PathParam; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
|
||
import io.quarkiverse.cxf.annotation.CXFClient; | ||
import io.quarkiverse.cxf.it.HelloService; | ||
|
||
@Path("/Soap12Rest") | ||
public class Soap12Rest { | ||
|
||
@CXFClient("soap12") | ||
HelloService soap12; | ||
|
||
HelloService getClient(String clientName) { | ||
switch (clientName) { | ||
case "soap12": { | ||
return soap12; | ||
} | ||
default: | ||
throw new IllegalArgumentException("Unexpected client name: " + clientName); | ||
} | ||
} | ||
|
||
@Path("/sync/{client}") | ||
@POST | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public String hello(@PathParam("client") String client, String body) { | ||
return getClient(client).hello(body); | ||
} | ||
|
||
} |
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
8 changes: 8 additions & 0 deletions
8
integration-tests/client-server/src/test/java/io/quarkiverse/cxf/it/soap12/Soap12IT.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,8 @@ | ||
package io.quarkiverse.cxf.it.soap12; | ||
|
||
import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
|
||
@QuarkusIntegrationTest | ||
class Soap12IT extends Soap12Test { | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
integration-tests/client-server/src/test/java/io/quarkiverse/cxf/it/soap12/Soap12Test.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,22 @@ | ||
package io.quarkiverse.cxf.it.soap12; | ||
|
||
import org.hamcrest.Matchers; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import io.quarkus.test.junit.QuarkusTest; | ||
import io.restassured.RestAssured; | ||
|
||
@QuarkusTest | ||
class Soap12Test { | ||
|
||
@Test | ||
void soap12() { | ||
RestAssured.given() | ||
.body("Joe") | ||
.post("/Soap12Rest/sync/soap12") | ||
.then() | ||
.statusCode(200) | ||
.body(Matchers.is("Hello Joe, Content-Type: application/soap+xml; action=\"helloAction\"; charset=UTF-8")); | ||
} | ||
|
||
} |