cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT Interface Mapping Not Found For HTTP Response

Former Member
0 Kudos

NW 04's SR 10, RFC => XSL => HTML

The scenario transforms data from R/3 into XML using XSLT and sends it to a 3rd party vendor wrapped inside a field of an HTML form via the HTTPS adapter. XSL was used for this instead of standard MessageMapping to meet the customer's needed for the XML data to be delivered in an untransformed structure, including their DTD declaration, so they could parse it upon receipt.

The outbound process is successful and the data is posted to the customer's database. Upon receipt, they send back a simple HTML form containing the success/failure in an H1 tag and our submitted XML data in the Body tag.

The problem is that due to the use of an XSL as the outbound mapping XI does not have a cached message structure to which it can map the response and thus throws the <b>Interface mapping .... does not exist in runtime cache</b> message. I do not feel this is a cache problem since I've cleared the XI cache, CPACache and anything else I've read as well as verified that the outbound mapping exists in the XI Cache list. I honestly feel I'm just missing a necessary piece to tell XI how to map the HTML response message back to the RFC Sender.

I have attempted numerous ideas, one of which included the use of the same RFC structure as the inbound and outbound MessageType so that a Response mapping could be specified but a NullPointerException was thrown in the mapping step since the response was of a completely different structure.

My question is how to handle the return data when using XSLT to create the outbound structure dynamically to prevent runtime errors in XI?

Thanks in advance,

Lane

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

The use of a Java mapping class was the solution where the response HTML file is parsed to strip out the Success/Failure status returned from the client system. The RFC response XML is being reconstructed and the status message added to the appropriate field to return a response to R/3.

Thanks to all who responded.

Lane

Former Member
0 Kudos

I believe I am following what you are saying Bhavesh though my XI knowledge is expanding with the progress of this project, I come from the Web Dynpro/Java side of SAP technology. In response to your statement about the return to the RFC, the developer is looking for a simple numeric return, 0 or 1, to let them know it succeeded or failed.

Once I figure out how to extract or map what I want from the HTML message I'll end up writing it to an Oracle database table for historical tracking purposes...nothing fancy.

Thanks again for the insight,

Lane

Former Member
0 Kudos

Thanks for the response Ravi.

You are correct in that we are posting XML inside of an HTML form and the response being returned is the same XML we sent inside an HTML form with a success/failure message added.

I also thought of using BPM but would prefer to solve it outside of that if possible.

Thanks,

Lane

Former Member
0 Kudos

Thanks for the quick response Bhavesh.

I figured out the response mapping option after I posted the question and also thought of using XSL to handle the response but I ran into a few other issues relating to my limited experience with XSLT that is preventing me from completely solving this.

The response is a plain HTML file structured as:

< html >

< body >

< h1 >Success/FailureMessage< /h1 >

< br >

Record Created

< br >< br > XML Data: <?xml version="1.0" encoding="utf-8"?><!DOCTYPE ....

< /body >

< /html >

where the actual XML data posted to the client system is embedded in the HTML body. Therefore the response is not well-formed XML and fails on parsing but also contains another XML message within the HTML structure that throws off parsing as well. Do you know XSLT well enough to get around this?

What about writing a Java function that just reads the incoming information but in doing this how do I go about mapping back to the RFC? Can I get ahold of the XI API somewhere to instantiate the RFC Objects dynamically?

Thanks again,

Lane

ravi_raman2
Active Contributor
0 Kudos

Terry,

I belive this is your issue..please correct me..

Sending a xml in a https request..you get a response that expects to be sent back to r/3......

One option is using BPM...so you send your request..wait for the response..map it and send it along to r/3 to validate your successful update in the third party system.

Regards

Ravi Raman

bhavesh_kantilal
Active Contributor
0 Kudos

Lane,

To be frank my knowledge of XSL mapping is limited. But yeah like you figured out XSL mapping always expects a valid XML and in your case the source response is obviously not a valid XML.

You are on the right track of using a Java Mapping for this. This is what you would need to do, Write a Java Mapping that picks out the required XML data that actuall needs to be maped to the RFC response.

You can either create the output of the Java Mapping as the RFC response or,

you can create a Datatype that matches with the Java Mappings output that will pull the needed XML out of the response. The next mapping in Response will be a graphical mapping that maps this output to the RFC response . In case you are wondering how, Interface Mappings allow you to define multiple mapping programs. The output of the first mapping is the input to the next and so on and the final output is the output of the interface mapping.

Which case to be used depends purely on what the actual response is.

Regards

Bhavesh

bhavesh_kantilal
Active Contributor
0 Kudos

Lane,

The Interface Mapping which you have created is it a Synchronous one?

The Outbound and Inbound Message interfaces should be Synch and the moment they are synch Interfaces, there will be 2 tabs , one for Request mapping and the other for response mapping.

The response mapping again needs to be a XSL mapping to read the HTML content from the HTTP adapter and map it to the RFC response strucuture.

Is this done?

Regards

Bhavesh