Skip to Content
0
Former Member
Sep 22, 2005 at 07:54 PM

Changing XML message into a string

61 Views

We have a mapping from an RFC to a specific XML message format - the weird thing is the webservice we are sending it to requires that it be sent as a single string <xmlDocument><b>string</b></xmlDocument> even though there are a couple hundred elements. So I need transform the result of my formentioned map into a string and also add a namespace. Can I do this with a custom java function? This is what the scenario looks like in the webservice we are hitting ...

SOAP

The following is a sample SOAP request and response. The placeholders shown need to be replaced with actual values.

POST /Mmmm.Application.Appl.Electronic.Order/Request.asmx HTTP/1.1

Host: staging.omm.appl.com

Content-Type: text/xml; charset=utf-8

Content-Length: length

SOAPAction: "https://www.appl.com/Mmmm.Application.Appl.Electronic.Order/Execute"

<?xml version="1.0" encoding="utf-8"?>

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

<soap:Header>

https://www.appl.com/Mmmm.Application.Appl.Electronic.Order/">

<correlationId>guid</correlationId>

</RequestSoapHeader>

</soap:Header>

<soap:Body>

https://www.appl.com/Mmmm.Application.Appl.Electronic.Order/">

<xmlDocument><b>string</b></xmlDocument>

</Execute>

</soap:Body>

</soap:Envelope>

HTTP/1.1 200 OK

Content-Type: text/xml; charset=utf-8

Content-Length: length

<?xml version="1.0" encoding="utf-8"?>

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

<soap:Body>

https://www.appl.com/Mmmm.Application.Appl.Electronic.Order/">

<ExecuteResult>string</ExecuteResult>

</ExecuteResponse>

</soap:Body>

</soap:Envelope>