cancel
Showing results for 
Search instead for 
Did you mean: 

Removing XML Declarations from Sender Payload

Former Member
0 Kudos

Hi Experts,

I am trying to get an XML file from a website for exchange rates using sender Axis Adapter. I have developed my scenario via

In payload i have XML declarations, which causes an exception as " <faultstring>org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.</faultstring> ".

When i remove those XML declarations in SOAPUI and send the payload, it works successfully. But since i am getting the XML document from a Website, i cannot remove them from payload till it reaches to sender communication channel, I also have tried XMLAnonmyizerBean.  Is there any module in communication channel or anyway i can do to remove those declarations?

Note: I can see the same exception when communication channel gets payload from website  via Alert Configuration.

Thanks.

View Entire Topic
javier_alcubilla
Contributor
0 Kudos

Hi Faruk

Try creating an adapter module that remove the information that is annoying to you

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e674...

Regards

Javi

Former Member
0 Kudos

Hi,

I am afraid, i dont have authorization to deploy new jar files to server. Any other suggestions?

javier_alcubilla
Contributor
0 Kudos

It's possible to create the module and deploy it through SUM. Your basis team could do it

steve_coombes
Participant
0 Kudos

Hello Faruk

Michal's example appears to be accessing a RESTful web service, without the SOAP document structure. So he sends the XML message including the declaration.

Are you consuming a SOAP web service?

Kind regards

Steve

Former Member
0 Kudos

Hi Steve,

The URL to get the Xml is http://www.tcmb.gov.tr/kurlar/today.xml


I just used the instructions referring to Michal's example, which he said Axis Adapter can be used to retrieve an xml file.

Regards.

steve_coombes
Participant
0 Kudos

Thanks.

The URL returns XML and I've just found another of Michal's posts in which he says this is not easy in PI

http://scn.sap.com/people/michal.krawczyk2/blog/2010/01/22/pixi-how-to-get-an-xml-file-from-a-web-pa...

That is from 2010 so the situation might have changed.

The response also includes a reference to a stylesheet

<?xml-stylesheet type="text/xsl" href="isokur.xsl"?>

which is why it is rendered as HTML when you open it in a browser. I don't know if that would be a problem in PI. Probably not.

Is the problem reading the XML, or using it as a payload in another message? The data in the SOAP body in your example seems to be the response from the web site.

You should still be able to use Michal's Axis example. Do you have the enableREST parameter set to avoid using SOAP?

regards

Steve

Former Member
0 Kudos

Hi Steve,

Thanks.

I am trying to get the XML and send it to anotther system via RFC.

But in cc monitoring i get the error as "the processing instructions is not allowed in soap message".

The soap body in my example is the wsdl from sender agreement. I was trying it manually from soapui after getting error in cc monitoring.

Only parameter in sender axis adapter is enableRest =true , how can i set it to avoid to use soap? Or how can i find the necessary value to do that?

Regards.

steve_coombes
Participant
0 Kudos

Hello Faruk

I have never used the Axis adapter so don't have much to suggest. The AXIS installation does seem to depend on PI patch-level but if you can use the AXIS classes then it should just work.

But if Axis is returning a SOAP message I don't think you'll be able to remove the XML declaration from the SOAP body before it fails in PI, i.e. I don't think an adapter module would work.

Have you tried using a HTTP or SOAP (with 'Do not use SOAP envelope') communication channel.

Kind regards

Steve