cancel
Showing results for 
Search instead for 
Did you mean: 

Error in building a soaprequest

SOLVED
Highlighted
New Contributor

Error in building a soaprequest

There seems to be a bug in composing a soap request when text in the body containing certain characters. On a request we got back that the message was not wellformed. Looking at the raw request we see a kind of mixing up with two body elements. Deducing we found out it goes wrong when the text contains the following characters "{${". 

When we have a request like this in the xml-view:

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:oob="http://www.OOBCWS03.OOBI0103.Request.com">

   <soapenv:Header/>

   <soapenv:Body>

      <oob:OOBCWS03Operation>

         <oob:OOBCWS03Operatie>

            <oob:cgn_tekstuit_indi>xxx</oob:cgn_tekstuit_indi>

            <oob:tekstuiti>{${</oob:tekstuiti>

         </oob:OOBCWS03Operatie>

      </oob:OOBCWS03Operation>

   </soapenv:Body>

</soapenv:Envelope>

 

We see after the invoke in the raw-view, a kind of mixed up request:

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:oob="http://www.OOBCWS03.OOBI0103.Request.com">

   <soapenv:Header/>

   <soapenv:Body>

      <oob:OOBCWS03Operation>

         <oob:OOBCWS03Operatie>

            <oob:cgn_tekstuit_indi>xxx</oob:cgn_tekstuit_indi>

            <oob:tekstuiti>{<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:oob="http://www.OOBCWS03.OOBI0103.Request.com">

   <soapenv:Header/>

   <soapenv:Body>

      <oob:OOBCWS03Operation>

         <oob:OOBCWS03Operatie>

            <oob:cgn_tekstuit_indi>xxx</oob:cgn_tekstuit_indi>

            <oob:tekstuiti>{${</oob:tekstuiti>

         </oob:OOBCWS03Operatie>

      </oob:OOBCWS03Operation>

   </soapenv:Body>

</soapenv:Envelope

 

As far as we know the characters {$ don't have a special meaning in XML, so it shouldn.t be a problem.

When we have a message with only "{$" (instead of "{${" ) the composing goes well:

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:oob="http://www.OOBCWS03.OOBI0103.Request.com">

   <soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"><wsa:Action>http://www.OOBCWS03.OOBI0103.com/OOBCWS03Port/OOBC...>

   <soapenv:Body>

      <oob:OOBCWS03Operation>

         <oob:OOBCWS03Operatie>

            <oob:cgn_tekstuit_indi>xxx</oob:cgn_tekstuit_indi>

            <oob:tekstuiti>{$</oob:tekstuiti>

         </oob:OOBCWS03Operatie>

      </oob:OOBCWS03Operation>

   </soapenv:Body>

</soapenv:Envelope>

 

The soapUI version we are using is 5.4.0. Are we doing something wrong or is this a bug?

Kind regards,

Iwan Mensink

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
New Contributor

Thanks HimanshuTayal for your quick respons,

Using /$ didn't help but you put me in right direction of escape characters, using $$ did the trick for me.

Thanks again.

View solution in original post

Tags (1)
3 REPLIES 3
Highlighted
Community Leader

@kiwi7 :

 

Yes you are correct, character $ doesn't have any special meaning to XML but character $ have special meaning in soapui. You can use \ to escape the character.

 

Hope it will help you to resolve the issue. 🙂


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal
Highlighted
New Contributor

Thanks HimanshuTayal for your quick respons,

Using /$ didn't help but you put me in right direction of escape characters, using $$ did the trick for me.

Thanks again.

View solution in original post

Tags (1)
Community Hero

Hey@kiwi7,

Sorry ive only just seen your post.

Yeah the reason you was getting the error was cos soapui recognised the $ symbol as though you were using properties. Adding an extra $ symbol, so it reads $$ indicates to soapui that it isnt a property placeholder.
Dunno why the xmlparser was reporting the error as malformed xml though, as $ characters in tag values is allowed. Actually dollar symbols in tagnames is allowed too....you just need to escape any of the 5 xml entities....ampersand(&), quote('), doublequote("), less than (<) and greater than (>)

Ta

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors