citrusframework / citrusframework/citrus

Http message sent instead of soap message if soap action send called with uri instead of autowired soap client

Open
#579 1 comment 0 reactions 0 assignees View on GitHub
bug good first issue prio-medium
Dominant language
Java
Stars
485
Forks
155
Avg merge
4d 22h
Merged PRs (30d)
6

Description

**Citrus Version**
v2.7.8

**Expected behavior**
Soap message should be sent

**Actual behavior**
http message sent

**Test case sample**
> Please, share the test case (as small as possible) which shows the issue

Actual behavior for
```java
soap(action -> action.client("http://localhost:8080/services/WS")
.send()
.soapAction("getTodoList")
.payload("\r\n" +
""));
```

Debug log:
```
08:57:40,387 DEBUG port.LoggingReporter| TEST STEP 2: send
08:57:40,422 DEBUG faultEndpointFactory| Found cached endpoint for uri 'http://localhost:8080/services/WS'
08:57:40,652 DEBUG ltCorrelationManager| Saving correlation key for 'citrus_message_correlator_HttpClient'
08:57:40,652 DEBUG context.TestContext| Setting variable: citrus_message_correlator_HttpClient with value: 'citrus_message_id = '9071da37-a0d2-49ff-a05d-e950d627a75c''
08:57:40,652 DEBUG client.HttpClient| Sending HTTP message to: 'http://localhost:8080/services/WS'
```

Actual behavior for passing client:
```java
@Autowired
private WebServiceClient todoSoapClient;

soap(action -> action.client(todoSoapClient)
.send()
.soapAction("getTodoList")
.payload("\r\n" +
""));
```

Debug log:
```
09:03:13,681 DEBUG port.LoggingReporter| TEST STEP 2: send
09:03:13,697 DEBUG ltCorrelationManager| Saving correlation key for 'citrus_message_correlator_todoSoapClient'
09:03:13,697 DEBUG context.TestContext| Setting variable: citrus_message_correlator_todoSoapClient with value: 'citrus_message_id = '5360f67a-8020-47b2-b0e3-1effb5bd84f1''
09:03:13,697 DEBUG ent.WebServiceClient| Sending SOAP message to endpoint: 'http://localhost:8080/services/WS'
09:03:13,697 DEBUG ent.WebServiceClient| Message to send is:
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two Java SOAP action samples in the issue, comparing the URI-based client with the autowired WebServiceClient and their debug logs. Trace how the URI is resolved and selected for sending; done means the URI form sends a SOAP message rather than an HTTP message while preserving the soapAction and payload.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.