From 6001ea5cdefbaf966636957bce548ac4b72be549 Mon Sep 17 00:00:00 2001 From: Nuvindu Date: Fri, 26 Apr 2024 15:04:22 +0530 Subject: [PATCH 1/8] [Automated] Update the native jar versions --- ballerina/Dependencies.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 7f54b03..3d21604 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.9.0-20240410-095500-2653a74d" +distribution-version = "2201.9.0-20240419-152500-bd530dd2" [[package]] org = "ballerina" From 68ff9ef98f857c34faaaf2321549801fae7fdac7 Mon Sep 17 00:00:00 2001 From: Nuvindu Date: Fri, 26 Apr 2024 15:38:00 +0530 Subject: [PATCH 2/8] Update SOAP service to handle requests without setting up the path in requests --- ballerina/modules/soap11/tests/http_soap_service.bal | 7 +++++++ ballerina/modules/soap12/tests/http_soap_service.bal | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/ballerina/modules/soap11/tests/http_soap_service.bal b/ballerina/modules/soap11/tests/http_soap_service.bal index 98f561f..f3dc331 100644 --- a/ballerina/modules/soap11/tests/http_soap_service.bal +++ b/ballerina/modules/soap11/tests/http_soap_service.bal @@ -28,6 +28,13 @@ crypto:PublicKey serverPublicKey = check crypto:decodeRsaPublicKeyFromTrustStore service / on new http:Listener(9090) { + resource function post .(http:Request request) returns http:Response|error { + http:Response response = new; + xml payload = xml `5`; + response.setPayload(payload); + return response; + } + resource function post getPayload(http:Request request) returns http:Response|error { http:Response response = new; response.setPayload(check (check request.getBodyParts())[0].getXml()); diff --git a/ballerina/modules/soap12/tests/http_soap_service.bal b/ballerina/modules/soap12/tests/http_soap_service.bal index 3bce134..096cf07 100644 --- a/ballerina/modules/soap12/tests/http_soap_service.bal +++ b/ballerina/modules/soap12/tests/http_soap_service.bal @@ -29,6 +29,13 @@ crypto:PublicKey serverPublicKey = check crypto:decodeRsaPublicKeyFromTrustStore service / on new http:Listener(9090) { + resource function post .(http:Request request) returns http:Response|error { + http:Response response = new; + xml payload = xml `5`; + response.setPayload(payload); + return response; + } + resource function post getPayload(http:Request request) returns http:Response|error { http:Response response = new; response.setPayload(check (check request.getBodyParts())[0].getXml()); From ecb2303f354625d36b45d7c157013c6faf233249 Mon Sep 17 00:00:00 2001 From: Nuvindu Date: Fri, 26 Apr 2024 15:38:23 +0530 Subject: [PATCH 3/8] Add SOAP services to validate ws securities in envelopes --- .../soap11/tests/http_secured_service.bal | 31 ++++++++++++++++++ .../soap12/tests/http_secured_service.bal | 32 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 ballerina/modules/soap11/tests/http_secured_service.bal create mode 100644 ballerina/modules/soap12/tests/http_secured_service.bal diff --git a/ballerina/modules/soap11/tests/http_secured_service.bal b/ballerina/modules/soap11/tests/http_secured_service.bal new file mode 100644 index 0000000..3361d5f --- /dev/null +++ b/ballerina/modules/soap11/tests/http_secured_service.bal @@ -0,0 +1,31 @@ +// Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 LLC. 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. + +import ballerina/http; + +service / on new http:Listener(9091) { + + resource function post .(http:Request request) returns http:Response|error { + http:Response response = new; + xml payload = xml `soap:MustUnderstandSystem.Web.Services.Protocols.SoapHeaderException: SOAP header Security was not understood. + at System.Web.Services.Protocols.SoapHeaderHandling.SetHeaderMembers(SoapHeaderCollection headers, Object target, SoapHeaderMapping[] mappings, SoapHeaderDirection direction, Boolean client) + at System.Web.Services.Protocols.SoapServerProtocol.CreateServerInstance() + at System.Web.Services.Protocols.WebServiceHandler.Invoke() + at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()`; + response.setPayload(payload); + return response; + } +} diff --git a/ballerina/modules/soap12/tests/http_secured_service.bal b/ballerina/modules/soap12/tests/http_secured_service.bal new file mode 100644 index 0000000..a0d1018 --- /dev/null +++ b/ballerina/modules/soap12/tests/http_secured_service.bal @@ -0,0 +1,32 @@ +// Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 LLC. 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. + +import ballerina/http; + +service / on new http:Listener(9091) { + + resource function post .(http:Request request) returns http:Response|error { + http:Response response = new; + xml payload = xml `soap:SenderSystem.Web.Services.Protocols.SoapException: Unable to handle request without a valid action parameter. Please supply a valid soap action. + at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest() + at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message) + at System.Web.Services.Protocols.SoapServerProtocol.Initialize() + at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response) + at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)`; + response.setPayload(payload); + return response; + } +} From a59df82c46828fd8b4e881e92a2f609c7aa2d847 Mon Sep 17 00:00:00 2001 From: Nuvindu Date: Fri, 26 Apr 2024 15:44:22 +0530 Subject: [PATCH 4/8] Update test cases --- .../soap11/tests/soap11_client_test.bal | 29 +++++++------ .../soap12/tests/soap12_client_test.bal | 42 ++++++++++--------- 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/ballerina/modules/soap11/tests/soap11_client_test.bal b/ballerina/modules/soap11/tests/soap11_client_test.bal index 0f27b04..5edc5f2 100644 --- a/ballerina/modules/soap11/tests/soap11_client_test.bal +++ b/ballerina/modules/soap11/tests/soap11_client_test.bal @@ -179,7 +179,7 @@ function testSendOnly() returns error? { `; - Client soapClient = check new ("http://www.dneonline.com/calculator.asmx?WSDL"); + Client soapClient = check new ("http://localhost:9090"); check soapClient->sendOnly(body, "http://tempuri.org/Add"); } @@ -206,8 +206,8 @@ function testSendOnlyError() returns error? { @test:Config { groups: ["soap11", "send_receive"] } -function testsendReceive() returns error? { - Client soapClient = check new ("http://www.dneonline.com/calculator.asmx?WSDL", +function testSendReceive() returns error? { + Client soapClient = check new ("http://localhost:9090", { inboundSecurity: NO_POLICY, outboundSecurity: {} @@ -244,19 +244,18 @@ function testSendReceiveWithHeaders() returns error? { `; - Client soapClient = check new ("http://www.dneonline.com/calculator.asmx?WSDL"); + Client soapClient = check new ("http://localhost:9090"); - xml response = check soapClient->sendReceive(body, "http://tempuri.org/Add", - {foo: ["bar1", "bar2"]}); + xml response = check soapClient->sendReceive(body, "http://tempuri.org/Add", {foo: ["bar1", "bar2"]}); xml expected = xml `5`; test:assertEquals(response, expected); } @test:Config { - groups: ["soap11"] + groups: ["soap11", "q"] } function testTransportBindingError() returns error? { - Client|Error soapClient = new ("http://www.dneonline.com/calculator.asmx?WSDL", + Client|Error soapClient = new ("http://localhost:9090", inboundSecurity = TRANSPORT_BINDING ); test:assertTrue(soapClient is Error); @@ -264,10 +263,10 @@ function testTransportBindingError() returns error? { } @test:Config { - groups: ["soap11"] + groups: ["soap11", "q"] } function testTransportBindingError2() returns error? { - Client|Error soapClient = new ("http://www.dneonline.com/calculator.asmx?WSDL", + Client|Error soapClient = new ("http://localhost:9090", inboundSecurity = [ TRANSPORT_BINDING ] @@ -297,10 +296,10 @@ function testSendReceiveError() returns error? { } @test:Config { - groups: ["soap11", "send_receive"] + groups: ["soap11", "send_receive", "q"] } function testSendReceiveWithTimestampTokenSecurity() returns error? { - Client soapClient = check new ("http://www.dneonline.com/calculator.asmx?WSDL", + Client soapClient = check new ("http://localhost:9091", { inboundSecurity: [ { @@ -332,7 +331,7 @@ function testSendReceiveWithTimestampTokenSecurity() returns error? { groups: ["soap11", "send_receive"] } function testSendReceiveWithUsernameTokenSecurity() returns error? { - Client soapClient = check new ("http://www.dneonline.com/calculator.asmx?WSDL", + Client soapClient = check new ("http://localhost:9091", { inboundSecurity: { username: "user", @@ -378,7 +377,7 @@ function testSendReceiveWithAsymmetricBindingSecurity() returns error? { }; crypto:PrivateKey clientPrivateKey = check crypto:decodeRsaPrivateKeyFromKeyStore(clientKeyStore, KEY_ALIAS, KEY_PASSWORD); - Client soapClient = check new ("http://www.dneonline.com/calculator.asmx?WSDL", + Client soapClient = check new ("http://localhost:9091", { inboundSecurity: { signatureAlgorithm: soap:RSA_SHA256, @@ -424,7 +423,7 @@ function testSendReceiveWithSymmetricBindingSecurity() returns error? { }; crypto:PrivateKey symmetricKey = check crypto:decodeRsaPrivateKeyFromKeyStore(keyStore, KEY_ALIAS, KEY_PASSWORD); - Client soapClient = check new ("http://www.dneonline.com/calculator.asmx?WSDL", + Client soapClient = check new ("http://localhost:9091", { inboundSecurity: { signatureAlgorithm: soap:RSA_SHA256, diff --git a/ballerina/modules/soap12/tests/soap12_client_test.bal b/ballerina/modules/soap12/tests/soap12_client_test.bal index 42334b7..ac54b37 100644 --- a/ballerina/modules/soap12/tests/soap12_client_test.bal +++ b/ballerina/modules/soap12/tests/soap12_client_test.bal @@ -62,7 +62,7 @@ function testSendOnly12() returns error? { `; - Client soapClient = check new ("http://www.dneonline.com/calculator.asmx?WSDL"); + Client soapClient = check new ("http://localhost:9090"); check soapClient->sendOnly(body, "http://tempuri.org/Add"); } @@ -103,7 +103,7 @@ function testSendReceive12WithAction() returns error? { groups: ["soap12", "send_receive"] } function testSendReceive12() returns error? { - Client soapClient = check new ("http://www.dneonline.com/calculator.asmx?WSDL"); + Client soapClient = check new ("http://localhost:9090"); xml body = xml ` @@ -252,7 +252,7 @@ function testSendReceive12WithHeaders() returns error? { `; - Client soapClient = check new ("http://www.dneonline.com/calculator.asmx?WSDL"); + Client soapClient = check new ("http://localhost:9090"); xml response = check soapClient->sendReceive(body, headers = {foo: ["bar1", "bar2"]}); @@ -275,7 +275,7 @@ function testSendOnly12WithoutSoapAction() returns error? { `; - Client soapClient = check new ("http://www.dneonline.com/calculator.asmx?WSDL"); + Client soapClient = check new ("http://localhost:9090"); check soapClient->sendOnly(body); } @@ -284,7 +284,7 @@ function testSendOnly12WithoutSoapAction() returns error? { groups: ["soap12"] } function testTransportBindingError() returns error? { - Client|Error soapClient = new ("http://www.dneonline.com/calculator.asmx?WSDL", inboundSecurity = TRANSPORT_BINDING); + Client|Error soapClient = new ("http://localhost:9091", inboundSecurity = TRANSPORT_BINDING); test:assertTrue(soapClient is Error); test:assertEquals((soapClient).message(), SOAP_CLIENT_ERROR); } @@ -293,7 +293,7 @@ function testTransportBindingError() returns error? { groups: ["soap12"] } function testTransportBindingError2() returns error? { - Client|Error soapClient = new ("http://www.dneonline.com/calculator.asmx?WSDL", + Client|Error soapClient = new ("http://localhost:9091", inboundSecurity = [ TRANSPORT_BINDING ] @@ -326,7 +326,7 @@ function testSendReceiveError() returns error? { groups: ["soap12", "send_receive"] } function testSendReceiveWithTimestampTokenSecurity() returns error? { - Client soapClient = check new ("http://www.dneonline.com/calculator.asmx?WSDL", + Client soapClient = check new ("http://localhost:9091", { inboundSecurity: [ { @@ -346,11 +346,12 @@ function testSendReceiveWithTimestampTokenSecurity() returns error? { `; xml response = check soapClient->sendReceive(body); - xml expected = xml `soap:MustUnderstandSystem.Web.Services.Protocols.SoapHeaderException: SOAP header Security was not understood. - at System.Web.Services.Protocols.SoapHeaderHandling.SetHeaderMembers(SoapHeaderCollection headers, Object target, SoapHeaderMapping[] mappings, SoapHeaderDirection direction, Boolean client) - at System.Web.Services.Protocols.SoapServerProtocol.CreateServerInstance() - at System.Web.Services.Protocols.WebServiceHandler.Invoke() - at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()`; + xml expected = xml `soap:SenderSystem.Web.Services.Protocols.SoapException: Unable to handle request without a valid action parameter. Please supply a valid soap action. + at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest() + at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message) + at System.Web.Services.Protocols.SoapServerProtocol.Initialize() + at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response) + at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)`; test:assertEquals(response.toString(), expected.toString()); } @@ -359,7 +360,7 @@ function testSendReceiveWithTimestampTokenSecurity() returns error? { groups: ["soap12", "send_receive"] } function testSendReceiveWithUsernameTokenSecurity() returns error? { - Client soapClient = check new ("http://www.dneonline.com/calculator.asmx?WSDL", + Client soapClient = check new ("http://localhost:9091", { inboundSecurity: { username: "user", @@ -380,11 +381,12 @@ function testSendReceiveWithUsernameTokenSecurity() returns error? { `; xml response = check soapClient->sendReceive(body); - xml expected = xml `soap:MustUnderstandSystem.Web.Services.Protocols.SoapHeaderException: SOAP header Security was not understood. - at System.Web.Services.Protocols.SoapHeaderHandling.SetHeaderMembers(SoapHeaderCollection headers, Object target, SoapHeaderMapping[] mappings, SoapHeaderDirection direction, Boolean client) - at System.Web.Services.Protocols.SoapServerProtocol.CreateServerInstance() - at System.Web.Services.Protocols.WebServiceHandler.Invoke() - at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()`; + xml expected = xml `soap:SenderSystem.Web.Services.Protocols.SoapException: Unable to handle request without a valid action parameter. Please supply a valid soap action. + at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest() + at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message) + at System.Web.Services.Protocols.SoapServerProtocol.Initialize() + at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response) + at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)`; test:assertEquals(response.toString(), expected.toString()); } @@ -406,7 +408,7 @@ function testSendReceiveWithAsymmetricBindingSecurity() returns error? { }; crypto:PrivateKey clientPrivateKey = check crypto:decodeRsaPrivateKeyFromKeyStore(clientKeyStore, KEY_ALIAS, KEY_PASSWORD); - Client soapClient = check new ("http://www.dneonline.com/calculator.asmx?WSDL", + Client soapClient = check new ("http://localhost:9091", { inboundSecurity: { signatureAlgorithm: soap:RSA_SHA256, @@ -453,7 +455,7 @@ function testSendReceiveWithSymmetricBindingSecurity() returns error? { }; crypto:PrivateKey symmetricKey = check crypto:decodeRsaPrivateKeyFromKeyStore(keyStore, KEY_ALIAS, KEY_PASSWORD); - Client soapClient = check new ("http://www.dneonline.com/calculator.asmx?WSDL", + Client soapClient = check new ("http://localhost:9091", { inboundSecurity: { signatureAlgorithm: soap:RSA_SHA256, From dd95fe64304f45075f9fbfb04671dad15d4a4f85 Mon Sep 17 00:00:00 2001 From: Nuvindu Date: Fri, 26 Apr 2024 16:17:20 +0530 Subject: [PATCH 5/8] Update license headers --- ballerina/modules/soap11/tests/http_secured_service.bal | 2 +- ballerina/modules/soap12/tests/http_secured_service.bal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ballerina/modules/soap11/tests/http_secured_service.bal b/ballerina/modules/soap11/tests/http_secured_service.bal index 3361d5f..7435351 100644 --- a/ballerina/modules/soap11/tests/http_secured_service.bal +++ b/ballerina/modules/soap11/tests/http_secured_service.bal @@ -1,4 +1,4 @@ -// Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. +// Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. // // WSO2 LLC. licenses this file to you under the Apache License, // Version 2.0 (the "License"); you may not use this file except diff --git a/ballerina/modules/soap12/tests/http_secured_service.bal b/ballerina/modules/soap12/tests/http_secured_service.bal index a0d1018..5373603 100644 --- a/ballerina/modules/soap12/tests/http_secured_service.bal +++ b/ballerina/modules/soap12/tests/http_secured_service.bal @@ -1,4 +1,4 @@ -// Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. +// Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. // // WSO2 LLC. licenses this file to you under the Apache License, // Version 2.0 (the "License"); you may not use this file except From 6403c078f54d60af219c8a6c890cf5655723b15c Mon Sep 17 00:00:00 2001 From: Nuvindu Date: Fri, 26 Apr 2024 16:21:22 +0530 Subject: [PATCH 6/8] Upodate the resource functions in the mock service to return `xml` --- ballerina/modules/soap11/tests/http_secured_service.bal | 9 +++------ ballerina/modules/soap12/tests/http_secured_service.bal | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/ballerina/modules/soap11/tests/http_secured_service.bal b/ballerina/modules/soap11/tests/http_secured_service.bal index 7435351..30a1c66 100644 --- a/ballerina/modules/soap11/tests/http_secured_service.bal +++ b/ballerina/modules/soap11/tests/http_secured_service.bal @@ -1,4 +1,4 @@ -// Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. +// Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). // // WSO2 LLC. licenses this file to you under the Apache License, // Version 2.0 (the "License"); you may not use this file except @@ -18,14 +18,11 @@ import ballerina/http; service / on new http:Listener(9091) { - resource function post .(http:Request request) returns http:Response|error { - http:Response response = new; - xml payload = xml `soap:MustUnderstandSystem.Web.Services.Protocols.SoapHeaderException: SOAP header Security was not understood. + resource function post .(http:Request request) returns xml|error { + return xml `soap:MustUnderstandSystem.Web.Services.Protocols.SoapHeaderException: SOAP header Security was not understood. at System.Web.Services.Protocols.SoapHeaderHandling.SetHeaderMembers(SoapHeaderCollection headers, Object target, SoapHeaderMapping[] mappings, SoapHeaderDirection direction, Boolean client) at System.Web.Services.Protocols.SoapServerProtocol.CreateServerInstance() at System.Web.Services.Protocols.WebServiceHandler.Invoke() at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()`; - response.setPayload(payload); - return response; } } diff --git a/ballerina/modules/soap12/tests/http_secured_service.bal b/ballerina/modules/soap12/tests/http_secured_service.bal index 5373603..78e4328 100644 --- a/ballerina/modules/soap12/tests/http_secured_service.bal +++ b/ballerina/modules/soap12/tests/http_secured_service.bal @@ -1,4 +1,4 @@ -// Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. +// Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com) // // WSO2 LLC. licenses this file to you under the Apache License, // Version 2.0 (the "License"); you may not use this file except @@ -18,15 +18,12 @@ import ballerina/http; service / on new http:Listener(9091) { - resource function post .(http:Request request) returns http:Response|error { - http:Response response = new; - xml payload = xml `soap:SenderSystem.Web.Services.Protocols.SoapException: Unable to handle request without a valid action parameter. Please supply a valid soap action. + resource function post .(http:Request request) returns xml|error { + return xml `soap:SenderSystem.Web.Services.Protocols.SoapException: Unable to handle request without a valid action parameter. Please supply a valid soap action. at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest() at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message) at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response) at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)`; - response.setPayload(payload); - return response; } } From e77e8e542ec688f0c01524b820a14354f6506843 Mon Sep 17 00:00:00 2001 From: Nuvindu Date: Fri, 26 Apr 2024 16:52:11 +0530 Subject: [PATCH 7/8] Remove unnecessary parameter in a resource function --- ballerina/modules/soap11/tests/http_secured_service.bal | 2 +- ballerina/modules/soap12/tests/http_secured_service.bal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ballerina/modules/soap11/tests/http_secured_service.bal b/ballerina/modules/soap11/tests/http_secured_service.bal index 30a1c66..4b04cb7 100644 --- a/ballerina/modules/soap11/tests/http_secured_service.bal +++ b/ballerina/modules/soap11/tests/http_secured_service.bal @@ -18,7 +18,7 @@ import ballerina/http; service / on new http:Listener(9091) { - resource function post .(http:Request request) returns xml|error { + resource function post .() returns xml|error { return xml `soap:MustUnderstandSystem.Web.Services.Protocols.SoapHeaderException: SOAP header Security was not understood. at System.Web.Services.Protocols.SoapHeaderHandling.SetHeaderMembers(SoapHeaderCollection headers, Object target, SoapHeaderMapping[] mappings, SoapHeaderDirection direction, Boolean client) at System.Web.Services.Protocols.SoapServerProtocol.CreateServerInstance() diff --git a/ballerina/modules/soap12/tests/http_secured_service.bal b/ballerina/modules/soap12/tests/http_secured_service.bal index 78e4328..13ca84a 100644 --- a/ballerina/modules/soap12/tests/http_secured_service.bal +++ b/ballerina/modules/soap12/tests/http_secured_service.bal @@ -18,7 +18,7 @@ import ballerina/http; service / on new http:Listener(9091) { - resource function post .(http:Request request) returns xml|error { + resource function post .() returns xml|error { return xml `soap:SenderSystem.Web.Services.Protocols.SoapException: Unable to handle request without a valid action parameter. Please supply a valid soap action. at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest() at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message) From f49dfce9cd5afcfc001de1f5ccb3c475e523d128 Mon Sep 17 00:00:00 2001 From: Nuvindu Date: Fri, 26 Apr 2024 17:04:24 +0530 Subject: [PATCH 8/8] Fix reveiw comments --- ballerina/modules/soap11/tests/http_soap_service.bal | 7 ++----- ballerina/modules/soap11/tests/soap11_client_test.bal | 6 +++--- ballerina/modules/soap12/tests/http_soap_service.bal | 7 ++----- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/ballerina/modules/soap11/tests/http_soap_service.bal b/ballerina/modules/soap11/tests/http_soap_service.bal index f3dc331..e72c8dd 100644 --- a/ballerina/modules/soap11/tests/http_soap_service.bal +++ b/ballerina/modules/soap11/tests/http_soap_service.bal @@ -28,11 +28,8 @@ crypto:PublicKey serverPublicKey = check crypto:decodeRsaPublicKeyFromTrustStore service / on new http:Listener(9090) { - resource function post .(http:Request request) returns http:Response|error { - http:Response response = new; - xml payload = xml `5`; - response.setPayload(payload); - return response; + resource function post .() returns xml|error { + return xml `5`; } resource function post getPayload(http:Request request) returns http:Response|error { diff --git a/ballerina/modules/soap11/tests/soap11_client_test.bal b/ballerina/modules/soap11/tests/soap11_client_test.bal index 5edc5f2..363fa3b 100644 --- a/ballerina/modules/soap11/tests/soap11_client_test.bal +++ b/ballerina/modules/soap11/tests/soap11_client_test.bal @@ -252,7 +252,7 @@ function testSendReceiveWithHeaders() returns error? { } @test:Config { - groups: ["soap11", "q"] + groups: ["soap11"] } function testTransportBindingError() returns error? { Client|Error soapClient = new ("http://localhost:9090", @@ -263,7 +263,7 @@ function testTransportBindingError() returns error? { } @test:Config { - groups: ["soap11", "q"] + groups: ["soap11"] } function testTransportBindingError2() returns error? { Client|Error soapClient = new ("http://localhost:9090", @@ -296,7 +296,7 @@ function testSendReceiveError() returns error? { } @test:Config { - groups: ["soap11", "send_receive", "q"] + groups: ["soap11", "send_receive"] } function testSendReceiveWithTimestampTokenSecurity() returns error? { Client soapClient = check new ("http://localhost:9091", diff --git a/ballerina/modules/soap12/tests/http_soap_service.bal b/ballerina/modules/soap12/tests/http_soap_service.bal index 096cf07..746b951 100644 --- a/ballerina/modules/soap12/tests/http_soap_service.bal +++ b/ballerina/modules/soap12/tests/http_soap_service.bal @@ -29,11 +29,8 @@ crypto:PublicKey serverPublicKey = check crypto:decodeRsaPublicKeyFromTrustStore service / on new http:Listener(9090) { - resource function post .(http:Request request) returns http:Response|error { - http:Response response = new; - xml payload = xml `5`; - response.setPayload(payload); - return response; + resource function post .() returns xml|error { + return xml `5`; } resource function post getPayload(http:Request request) returns http:Response|error {