cancel
Showing results for 
Search instead for 
Did you mean: 

"<" in soap message

Former Member
0 Kudos

Hi,

We receive a soap message with the characters "&lt" and "&gt". The soap adapter is unable to parse this as "<" and ">". Is there a way to translate "&lt" to "<" without creating an adapter module?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

sunil_singh13
Active Contributor
0 Kudos

you have to use java mapping or UDF ;lt& means it is a string in a XML to make it as a node i.e to change ;lt& to "<" use java mapping . if u can give me your input file and desired output file i can help you more on that (can give you java code) .Don't use graphical mapping it will give you problem

reward points if helpful .

Please ask if any problem .

Thanks

Sunil Singh

Edited by: SUNIL SINGH on Mar 12, 2008 7:54 AM

Edited by: SUNIL SINGH on Mar 12, 2008 8:00 AM

Former Member
0 Kudos

Hi Sunil,

The input payload is similar to the below

<Request xmlns="http://test.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

<RequestResult>&lt;ACKNOWLEDGEMENT VALUE="no"&gt;&lt;ERROR_CODE="test"/&gt;&lt;/ACKNOWLEDGEMENT&gt;</RequestResult>

</Request>

The string value is sent for the values in node, RequestResult.

The output has to be the exact same but instead of the "& lt ;" and "& gt ;" represented in the node, RequestResult, it needs to be translated to "<" and ">" xml nodes and not string values.

Thanks for your help.

Best Regards.

Answers (2)

Answers (2)

stefan_grube
Active Contributor
0 Kudos

& l t ; is text and different to <

& lt ; node & gt ; is text too and different to <node>

There is no way to change this automatically.

The SOAP sender must send valid XML, otherwise you run into errors.

If you are using a test tool, then apply valid XML to this.

Regards

Stefan

Former Member
0 Kudos

Hi Stefan,

The 3rd party system is sending it in that format with & lt ;. Is there any way we can change this? I thought at the least we can use an adapter module to change this. Is my thinking incorrect?

Thanks.

stefan_grube
Active Contributor
0 Kudos

I thought, you use a test tool to send the message?

Is the sender of the message creating that code?

Stefan

Edited by: Stefan Grube on Mar 19, 2008 2:28 PM

Former Member
0 Kudos

Yes, the sender is actually sending it to us in that format.

Thanks.

stefan_grube
Active Contributor
0 Kudos

In that case, you have to write a Java mapping for de-escaping the < > signs.

Regards

Stefan

ravi_raman2
Active Contributor
0 Kudos

Duke..

You are getting the charecters..&lt in the header or payload..

Regards

Ravi Raman

Former Member
0 Kudos

In the Payload (Soap Body).

bhavesh_kantilal
Active Contributor
0 Kudos

It should be & lt ; (without the spaces)

Is this how the source sends the data? XI by default is able to do this conversion if the characters are escaped as above. I think in your case they are not

Regards

Bhavesh

Former Member
0 Kudos

Hi,

I'm using soapUI to test an example soap message that would be sent to our webservice. If I send the message with "& l t ;" (w/o spaces), and when I view the payload in XI, it does show as <, but it errors in the mapping with the following error:

Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd

When I send the soap message with actual "<" instead of "& l t ;" (w/o spaces), it is processed successfully.

Regards,

Duke

bhavesh_kantilal
Active Contributor
0 Kudos

1.When you enter < as it is in the SOAP GUI, check the Incoming payload in MONI of XI by saying view souce . This < would now become & lt ;

2. Now when you enter & lt ; in the SOAP GUI In the input screen, can you check hte XML that is generated by the SOAP GUI itself ? Or check the incoming payload - the payload is not a valid XML.

The SOAP GUI is interpreting this and creating a invalid XML I guess.

You can also manually test your mapping by entering & lt ; in the input field in one of your fields and check how this works.

Regards

Bhavesh

Former Member
0 Kudos

You are correct, when checking the source in the inbound payload, the XML does not look correct. The < and > looks and is treated like its text and not XML.

I did try using the & lt ; in one of the fields in my mapping and it does show as <.

I'm not sure if it is the SOAP GUI that is generating the XML incorrectly, or it is a restriction in the adapter to be able to translate properly. But, from your previous post you mentioned that it should automatically be able to translate the $ lt ; into <?

Thanks.

bhavesh_kantilal
Active Contributor
0 Kudos

It seems to be a problem with the SOAP GUI.

Also if I were to a program a GUI, I would be writing my code to be such that if user enters < , then replace it with & lt ; .

Now when you enter & lt ; the GUI would replace this as & amp ; lt ; and somewhere this is causing an issue.

Rest assured that there is no bug on XI or the SOAP adapter and this seems to be more of a issue with the Client.

Regards

Bhavesh