Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

${something} in soap

I have the following code:

@WebMethod
public String replaceEnvironment(String someVar) {
    return someVar;
}

When i'm trying to send a message with string containing ${something} subsequence, my string is truncated after unmashalling: ${something} substring is dissappeared. What is the reason of this behaviour? I need to have the same string as i send in replaceEnvironment method.

P.S. I don't use libs like Velocity or Freemaker in my project.

SOAP examples.

Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"     xmlns:ws="http://ws.test.net/">
    <soapenv:Header/>
    <soapenv:Body>
    <ws:replaceEnvironment>
        <!--Optional:-->
        <arg0>test ${test} test</arg0>
    </ws:replaceEnvironment>
    </soapenv:Body>
</soapenv:Envelope>

Response:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
        <ns2:replaceEnvironmentResponse xmlns:ns2="http://ws.test.net/">
            <return>test  test</return>
        </ns2:replaceEnvironmentResponse>
    </S:Body>
</S:Envelope>

Thanks.

like image 509
Artem Avatar asked Sep 11 '26 14:09

Artem


1 Answers

Are you by any chance making the test call with soapUI?

That gives special meaning to ${xxx} sequences in the request, replacing them with the value of the equivalent soapUI property.

If this is the case, maybe you could use "& # 3 6 ;" (without spaces or quotes) in your request instead of the dollar, and see if soapUI then ignores your sequence and sends it through to your backend code.

HTH

like image 177
davidfrancis Avatar answered Sep 13 '26 03:09

davidfrancis