You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/03/12 13:50:24 UTC

[GitHub] [camel-quarkus] mmelko opened a new pull request #883: Add soap dataformat quarkus extension

mmelko opened a new pull request #883: Add soap dataformat quarkus extension
URL: https://github.com/apache/camel-quarkus/pull/883
 
 
   fix #763

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-quarkus] mmelko commented on a change in pull request #883: Add soap dataformat quarkus extension

Posted by GitBox <gi...@apache.org>.
mmelko commented on a change in pull request #883: Add soap dataformat quarkus extension
URL: https://github.com/apache/camel-quarkus/pull/883#discussion_r391669870
 
 

 ##########
 File path: extensions/soap/runtime/pom.xml
 ##########
 @@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.camel.quarkus</groupId>
+        <artifactId>camel-quarkus-soap-parent</artifactId>
+        <version>1.1.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-soap</artifactId>
+    <name>Camel Quarkus :: Soap dataformat :: Runtime</name>
+
+    <properties>
+        <firstVersion>1.0.0-M5</firstVersion>
+        <saaj.version>1.5.0</saaj.version>
 
 Review comment:
   I forgot to remove this. Thanks!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-quarkus] ppalaga merged pull request #883: Add soap dataformat quarkus extension

Posted by GitBox <gi...@apache.org>.
ppalaga merged pull request #883: Add soap dataformat quarkus extension
URL: https://github.com/apache/camel-quarkus/pull/883
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #883: Add soap dataformat quarkus extension

Posted by GitBox <gi...@apache.org>.
ppalaga commented on a change in pull request #883: Add soap dataformat quarkus extension
URL: https://github.com/apache/camel-quarkus/pull/883#discussion_r391897855
 
 

 ##########
 File path: integration-tests/soap/src/test/java/org/apache/camel/quarkus/component/soap/it/SoapTest.java
 ##########
 @@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.soap.it;
+
+import java.util.UUID;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.http.ContentType;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+@QuarkusTest
+class SoapTest {
+
+    @Test
+    public void testMarshal() {
+        final String msg = UUID.randomUUID().toString().replace("-", "");
+        String resp = RestAssured.given()
+                .contentType(ContentType.TEXT).body(msg).post("/soap/marshal") //
+                .then().statusCode(201)
+                .extract().body().asString();
+        assertThat(resp).contains("<ns3:getCustomersByName>");
+        assertThat(resp).contains("<name>" + msg + "</name>");
+        assertThat(resp).contains("<ns2:Envelope xmlns:ns2=\"http://schemas.xmlsoap.org/soap/envelope/\"");
+
+        System.out.println(resp);
 
 Review comment:
   The last issue from my PoV.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-quarkus] ppalaga commented on issue #883: Add soap dataformat quarkus extension

Posted by GitBox <gi...@apache.org>.
ppalaga commented on issue #883: Add soap dataformat quarkus extension
URL: https://github.com/apache/camel-quarkus/pull/883#issuecomment-598789660
 
 
   Thanks, @mmelko !

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #883: Add soap dataformat quarkus extension

Posted by GitBox <gi...@apache.org>.
ppalaga commented on a change in pull request #883: Add soap dataformat quarkus extension
URL: https://github.com/apache/camel-quarkus/pull/883#discussion_r391643417
 
 

 ##########
 File path: integration-tests/soap/src/main/resources/application.properties
 ##########
 @@ -0,0 +1,16 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
 
 Review comment:
   Empty application.properties can be removed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #883: Add soap dataformat quarkus extension

Posted by GitBox <gi...@apache.org>.
ppalaga commented on a change in pull request #883: Add soap dataformat quarkus extension
URL: https://github.com/apache/camel-quarkus/pull/883#discussion_r391638029
 
 

 ##########
 File path: integration-tests/soap/pom.xml
 ##########
 @@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.camel.quarkus</groupId>
+        <artifactId>camel-quarkus-integration-tests</artifactId>
+        <version>1.1.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-quarkus-integration-test-soap</artifactId>
+    <name>Camel Quarkus :: Integration Tests :: Soap dataformat</name>
+    <description>Integration tests for Camel Quarkus Soap dataformat extension</description>
+
+    <properties>
+        <!-- mvnd, a.k.a. Maven Daemon: https://github.com/gnodet/mvnd -->
+        <!-- The following rule tells mvnd to build the listed deployment modules before this module. -->
+        <!-- This is important because mvnd builds modules in parallel by default. The deployment modules are not -->
+        <!-- explicit dependencies of this module in the Maven sense, although they are required by the Quarkus Maven plugin. -->
+        <!-- Please update rule whenever you change the dependencies of this module by running -->
+        <!--     mvn process-resources -Pformat    from the root directory -->
+        <mvnd.builder.rule>camel-quarkus-direct-deployment,camel-quarkus-soap-deployment,camel-quarkus-support-policy-deployment</mvnd.builder.rule>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-soap</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-direct</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-resteasy</artifactId>
+        </dependency>
+
+        <!-- test dependencies -->
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-junit5</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>io.rest-assured</groupId>
+            <artifactId>rest-assured</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>io.quarkus</groupId>
+                <artifactId>quarkus-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>build</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>native</id>
+            <activation>
+                <property>
+                    <name>native</name>
+                </property>
+            </activation>
+            <properties>
+                <quarkus.package.type>native</quarkus.package.type>
+            </properties>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-failsafe-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>integration-test</goal>
+                                    <goal>verify</goal>
+                                </goals>
+                                <configuration>
+                                    <systemProperties>
+                                        <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
+                                    </systemProperties>
+                                </configuration>
 
 Review comment:
   ```suggestion
   ```
   
   The config can be removed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-quarkus] mmelko commented on a change in pull request #883: Add soap dataformat quarkus extension

Posted by GitBox <gi...@apache.org>.
mmelko commented on a change in pull request #883: Add soap dataformat quarkus extension
URL: https://github.com/apache/camel-quarkus/pull/883#discussion_r391669249
 
 

 ##########
 File path: integration-tests/soap/src/main/java/org/apache/camel/quarkus/component/soap/it/SoapResource.java
 ##########
 @@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.soap.it;
+
+import java.net.URI;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.quarkus.component.soap.it.example.GetCustomersByName;
+import org.jboss.logging.Logger;
+
+@Path("/soap")
+@ApplicationScoped
+public class SoapResource {
+
+    private static final Logger LOG = Logger.getLogger(SoapResource.class);
+
+    @Inject
+    ProducerTemplate producerTemplate;
+
+    @Path("/marshal")
+    @POST
+    @Consumes(MediaType.TEXT_PLAIN)
+    @Produces(MediaType.APPLICATION_XML)
+    public Response marshall(String message) throws Exception {
+        LOG.infof("Sending to soap: %s", message);
+        GetCustomersByName request = new GetCustomersByName();
+        request.setName(message);
+
+        final String response = producerTemplate.requestBody("direct:marshal", request, String.class);
+
+        return Response
+                .created(new URI("https://camel.apache.org/"))
+                .entity(response)
+                .build();
+    }
+
+    @Path("/marshal-soap12")
+    @POST
+    @Consumes(MediaType.TEXT_PLAIN)
+    @Produces(MediaType.APPLICATION_XML)
+    public Response marshalSoap12(String message) throws Exception {
+        GetCustomersByName request = new GetCustomersByName();
+        request.setName(message);
+
+        final String response = producerTemplate.requestBody("direct:marshal-soap12", request, String.class);
+
+        return Response
+                .created(new URI("https://camel.apache.org/"))
+                .entity(response)
+                .build();
+    }
+
+    @Path("/unmarshal")
+    @POST
+    @Consumes(MediaType.APPLICATION_XML)
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response unmarshal(String message) throws Exception {
+        final GetCustomersByName response = producerTemplate.requestBody("direct:unmarshal", message, GetCustomersByName.class);
+
+        return Response
+                .created(new URI("https://camel.apache.org/"))
+                .entity(response.getName())
+                .build();
+    }
+
+    @Path("/unmarshal-soap12")
+    @POST
+    @Consumes(MediaType.APPLICATION_XML)
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response unmarshalSoap12(String message) throws Exception {
+        final GetCustomersByName response = producerTemplate.requestBody("direct:unmarshal-soap12", message,
+                GetCustomersByName.class);
+
+        return Response
+                .created(new URI("https://camel.apache.org/"))
+                .entity(response.getName())
+                .build();
+    }
+
+    @Path("/round")
+    @POST
+    @Consumes(MediaType.TEXT_PLAIN)
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response round(String message) throws Exception {
+        LOG.infof("Sending to soap: %s", message);
+        GetCustomersByName request = new GetCustomersByName();
+        request.setName(message);
+        final String xml = producerTemplate.requestBody("direct:marshal", request, String.class);
+        LOG.infof("Got response from marshal: %s", xml);
+
 
 Review comment:
   I was testing if marshaled message could be also un-marshaled. I had some issues with that so I kept it there. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #883: Add soap dataformat quarkus extension

Posted by GitBox <gi...@apache.org>.
ppalaga commented on a change in pull request #883: Add soap dataformat quarkus extension
URL: https://github.com/apache/camel-quarkus/pull/883#discussion_r391644106
 
 

 ##########
 File path: integration-tests/soap/src/test/java/org/apache/camel/quarkus/component/soap/it/SoapTest.java
 ##########
 @@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.soap.it;
+
+import java.util.UUID;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.http.ContentType;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+@QuarkusTest
+class SoapTest {
+
+    @Test
+    public void testMarshal() {
+        final String msg = UUID.randomUUID().toString().replace("-", "");
+        String resp = RestAssured.given()
+                .contentType(ContentType.TEXT).body(msg).post("/soap/marshal") //
+                .then().statusCode(201)
+                .extract().body().asString();
+        assertThat(resp).contains("<ns3:getCustomersByName>");
+        assertThat(resp).contains("<name>" + msg + "</name>");
+        assertThat(resp).contains("<ns2:Envelope xmlns:ns2=\"http://schemas.xmlsoap.org/soap/envelope/\"");
+
+        System.out.println(resp);
 
 Review comment:
   Could you please remove the System.out.println ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-quarkus] mmelko commented on issue #883: Add soap dataformat quarkus extension

Posted by GitBox <gi...@apache.org>.
mmelko commented on issue #883: Add soap dataformat quarkus extension
URL: https://github.com/apache/camel-quarkus/pull/883#issuecomment-598697633
 
 
   ```xml
   <dependency>
             <groupId>javax.xml.ws</groupId>
             <artifactId>jaxws-api</artifactId>
   </dependency>
   ```
    Had to be added to work this with java 11. Now I'm waiting for CI results

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #883: Add soap dataformat quarkus extension

Posted by GitBox <gi...@apache.org>.
ppalaga commented on a change in pull request #883: Add soap dataformat quarkus extension
URL: https://github.com/apache/camel-quarkus/pull/883#discussion_r391648169
 
 

 ##########
 File path: integration-tests/soap/src/main/java/org/apache/camel/quarkus/component/soap/it/SoapResource.java
 ##########
 @@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.soap.it;
+
+import java.net.URI;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.quarkus.component.soap.it.example.GetCustomersByName;
+import org.jboss.logging.Logger;
+
+@Path("/soap")
+@ApplicationScoped
+public class SoapResource {
+
+    private static final Logger LOG = Logger.getLogger(SoapResource.class);
+
+    @Inject
+    ProducerTemplate producerTemplate;
+
+    @Path("/marshal")
+    @POST
+    @Consumes(MediaType.TEXT_PLAIN)
+    @Produces(MediaType.APPLICATION_XML)
+    public Response marshall(String message) throws Exception {
+        LOG.infof("Sending to soap: %s", message);
+        GetCustomersByName request = new GetCustomersByName();
+        request.setName(message);
+
+        final String response = producerTemplate.requestBody("direct:marshal", request, String.class);
+
+        return Response
+                .created(new URI("https://camel.apache.org/"))
+                .entity(response)
+                .build();
+    }
+
+    @Path("/marshal-soap12")
+    @POST
+    @Consumes(MediaType.TEXT_PLAIN)
+    @Produces(MediaType.APPLICATION_XML)
+    public Response marshalSoap12(String message) throws Exception {
+        GetCustomersByName request = new GetCustomersByName();
+        request.setName(message);
+
+        final String response = producerTemplate.requestBody("direct:marshal-soap12", request, String.class);
+
+        return Response
+                .created(new URI("https://camel.apache.org/"))
+                .entity(response)
+                .build();
+    }
 
 Review comment:
   It looks like /marshal-soap12 and /marshal differ only in the name of the direct endpoint. Could we perhaps have just one rest endpoint with a route URI param, something like https://github.com/apache/camel-quarkus/blob/master/integration-tests/dataformat/src/main/java/org/apache/camel/quarkus/component/dataformat/it/DataformatResource.java#L43-L57
   
   And the same for unmarshal

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #883: Add soap dataformat quarkus extension

Posted by GitBox <gi...@apache.org>.
ppalaga commented on a change in pull request #883: Add soap dataformat quarkus extension
URL: https://github.com/apache/camel-quarkus/pull/883#discussion_r391648169
 
 

 ##########
 File path: integration-tests/soap/src/main/java/org/apache/camel/quarkus/component/soap/it/SoapResource.java
 ##########
 @@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.soap.it;
+
+import java.net.URI;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.quarkus.component.soap.it.example.GetCustomersByName;
+import org.jboss.logging.Logger;
+
+@Path("/soap")
+@ApplicationScoped
+public class SoapResource {
+
+    private static final Logger LOG = Logger.getLogger(SoapResource.class);
+
+    @Inject
+    ProducerTemplate producerTemplate;
+
+    @Path("/marshal")
+    @POST
+    @Consumes(MediaType.TEXT_PLAIN)
+    @Produces(MediaType.APPLICATION_XML)
+    public Response marshall(String message) throws Exception {
+        LOG.infof("Sending to soap: %s", message);
+        GetCustomersByName request = new GetCustomersByName();
+        request.setName(message);
+
+        final String response = producerTemplate.requestBody("direct:marshal", request, String.class);
+
+        return Response
+                .created(new URI("https://camel.apache.org/"))
+                .entity(response)
+                .build();
+    }
+
+    @Path("/marshal-soap12")
+    @POST
+    @Consumes(MediaType.TEXT_PLAIN)
+    @Produces(MediaType.APPLICATION_XML)
+    public Response marshalSoap12(String message) throws Exception {
+        GetCustomersByName request = new GetCustomersByName();
+        request.setName(message);
+
+        final String response = producerTemplate.requestBody("direct:marshal-soap12", request, String.class);
+
+        return Response
+                .created(new URI("https://camel.apache.org/"))
+                .entity(response)
+                .build();
+    }
 
 Review comment:
   It looks like /marshal-soap12 and /marshal differ only in the of the direct endpoint. Could we perhaps have just one rest endpoint with a route URI param, something like https://github.com/apache/camel-quarkus/blob/master/integration-tests/dataformat/src/main/java/org/apache/camel/quarkus/component/dataformat/it/DataformatResource.java#L43-L57
   
   And the same for unmarshal

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #883: Add soap dataformat quarkus extension

Posted by GitBox <gi...@apache.org>.
ppalaga commented on a change in pull request #883: Add soap dataformat quarkus extension
URL: https://github.com/apache/camel-quarkus/pull/883#discussion_r391645384
 
 

 ##########
 File path: integration-tests/soap/src/main/java/org/apache/camel/quarkus/component/soap/it/SoapResource.java
 ##########
 @@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.soap.it;
+
+import java.net.URI;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.quarkus.component.soap.it.example.GetCustomersByName;
+import org.jboss.logging.Logger;
+
+@Path("/soap")
+@ApplicationScoped
+public class SoapResource {
+
+    private static final Logger LOG = Logger.getLogger(SoapResource.class);
+
+    @Inject
+    ProducerTemplate producerTemplate;
+
+    @Path("/marshal")
+    @POST
+    @Consumes(MediaType.TEXT_PLAIN)
+    @Produces(MediaType.APPLICATION_XML)
+    public Response marshall(String message) throws Exception {
+        LOG.infof("Sending to soap: %s", message);
+        GetCustomersByName request = new GetCustomersByName();
+        request.setName(message);
+
+        final String response = producerTemplate.requestBody("direct:marshal", request, String.class);
+
+        return Response
+                .created(new URI("https://camel.apache.org/"))
+                .entity(response)
+                .build();
+    }
+
+    @Path("/marshal-soap12")
+    @POST
+    @Consumes(MediaType.TEXT_PLAIN)
+    @Produces(MediaType.APPLICATION_XML)
+    public Response marshalSoap12(String message) throws Exception {
+        GetCustomersByName request = new GetCustomersByName();
+        request.setName(message);
+
+        final String response = producerTemplate.requestBody("direct:marshal-soap12", request, String.class);
+
+        return Response
+                .created(new URI("https://camel.apache.org/"))
+                .entity(response)
+                .build();
+    }
+
+    @Path("/unmarshal")
+    @POST
+    @Consumes(MediaType.APPLICATION_XML)
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response unmarshal(String message) throws Exception {
+        final GetCustomersByName response = producerTemplate.requestBody("direct:unmarshal", message, GetCustomersByName.class);
+
+        return Response
+                .created(new URI("https://camel.apache.org/"))
+                .entity(response.getName())
+                .build();
+    }
+
+    @Path("/unmarshal-soap12")
+    @POST
+    @Consumes(MediaType.APPLICATION_XML)
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response unmarshalSoap12(String message) throws Exception {
+        final GetCustomersByName response = producerTemplate.requestBody("direct:unmarshal-soap12", message,
+                GetCustomersByName.class);
+
+        return Response
+                .created(new URI("https://camel.apache.org/"))
+                .entity(response.getName())
+                .build();
+    }
+
+    @Path("/round")
+    @POST
+    @Consumes(MediaType.TEXT_PLAIN)
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response round(String message) throws Exception {
+        LOG.infof("Sending to soap: %s", message);
+        GetCustomersByName request = new GetCustomersByName();
+        request.setName(message);
+        final String xml = producerTemplate.requestBody("direct:marshal", request, String.class);
+        LOG.infof("Got response from marshal: %s", xml);
+
 
 Review comment:
   Unless /round is doing something not covered by the above /marshal /unmarshal endpoints, I'd vote for removing it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-quarkus] jamesnetherton commented on a change in pull request #883: Add soap dataformat quarkus extension

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on a change in pull request #883: Add soap dataformat quarkus extension
URL: https://github.com/apache/camel-quarkus/pull/883#discussion_r391650962
 
 

 ##########
 File path: extensions/soap/runtime/pom.xml
 ##########
 @@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.camel.quarkus</groupId>
+        <artifactId>camel-quarkus-soap-parent</artifactId>
+        <version>1.1.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-soap</artifactId>
+    <name>Camel Quarkus :: Soap dataformat :: Runtime</name>
+
+    <properties>
+        <firstVersion>1.0.0-M5</firstVersion>
+        <saaj.version>1.5.0</saaj.version>
 
 Review comment:
   Is the `saaj.version` version property used anywhere?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services