cancel
Showing results for 
Search instead for 
Did you mean: 

XML and HTTP adapter

Former Member
0 Kudos

I am having the following Scenario File1(Request) to HTTP (Synchronous) and send the response from HTTP to File2.

The response what I am going to receive is below. But I am getting an error message "Invalid at the top level of the document". Thats True because the first 5 lines of the response are not an XML format? How to take care of the situation. Should I need use anything special in my Receiver HTTP adapter?

Content-Type: multipart/mixed; boundary="----=_Part_0_10550230.1105574425445"

-


=_Part_0_10550230.1105574425445

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

Content-ID: <1105574425572.1197583259@cetus.xyz.com>

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

<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd">

<cXML timestamp="2005-01-12T16:00:25-08:00"

payloadID="1105574425428-5167970095322563427@10.10.13.103">

<Response>

<Status code="200" text="OK"/>

<DataResponse>

<Attachment> <URL>cid:1105574422695.1816707419@cetus.xyz.com</URL>

</Attachment>

</DataResponse>

</Response>

</cXML>

Accepted Solutions (1)

Accepted Solutions (1)

agasthuri_doss
Active Contributor
0 Kudos

Hi Mohini,

If the Size of the Data is more go for Java Mapping. XSLT will consume more memory.As Bhavesh Kantilal mentioned it is diffcult to acheive it at this moment.

Regards

Agasthuri Doss

Answers (1)

Answers (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Mohini,

If no other solution is available, would suggest you go for JAVA / XSL mapping.

Graphical Mapping validates your SOurce Message against the Schema, this can be avoided in Java and XSLT where no such validation occurs.

Regards,

Bhavesh

Former Member
0 Kudos

Thanks Bhavesh. Would u or some other experts could help me out on writing an XSLT mapping or a Java mapping, how to start or where to start and how to proceed please

Thanks a lot.

moorthy
Active Contributor
0 Kudos

For Java Mapping-

/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i

/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii

XSLT Mapping-

first you need to have XML editors like XMLSpy, Stylus studio for this.

For syntaxt etc -

http://www.w3schools.com/xsl/default.asp

Regards,

Moorthy

former_member206604
Active Contributor
0 Kudos

Hi Mohini,

I don't think this can be achieved using XSLT mapping. As Bhavesh said XSLT dose'nt check for the structure but it does checks if it is a well formed XML in first place. The one which you posted is not at all a XML document, I would say its a text document or a string.

So it would be possible either by ABAP mapping or Java mapping. But while doing it in ABAP or Java you should not directly take the input stream and parse it coz this is not a XML strucutre. The parser will obviously throw an error saying not a well formed XML. So first you need to take this as a string and remove those first 5 line using string manipulation/string functions. Then return the rest of the string is a XML, which you can parse it and map to its target message type.

In general any mapping that is using XPATH/path for mapping will fail, only mapping that uses streams can be used. So you can use either ABAP or Java.

Thanks,

Prakash

Former Member
0 Kudos

Thanks Prakash for your Nice Explanation. I am planning to use Java Mapping.

How should I start this assignment? The Text document is the Response from an URL.

Where should I write this Java code and how should I direct the Response from the URL to java, and once I form an XML how should I direct to XI?

agasthuri_doss
Active Contributor
0 Kudos

Hi Mohini,

Whether you have installed NDS (Netweaver Development Studio ) Thru that we can develop the Java Mapping code and we can test, Thru NDS it is possible to deploy in the Server.

Regards

Agasthuri Doss