cancel
Showing results for 
Search instead for 
Did you mean: 

Error referring a external dtd in incoming file

Former Member
0 Kudos

Hi,

I have a simple File - Webservice scenario.The challenge is the incoming file which is generated from lotusnotes and which contains a line

"<!DOCTYPE database SYSTEM 'xmlschemas/domino_7_0_2.dtd'>"

I'm able to generates the message structure succesfully.But at runtime the above line gives error.The input payload is blank in MONI with the error

"The system cannot locate the resource specified. Error processing resource 'xmlschemas/domino_7_0_2.dtd'. Error processing...

<!DOCTYPE database SYSTEM 'xmlschemas/domino_7_0_2.dtd'>"

A work around which I have tried is by writting a adapter module which deletes this line and the scenario works fine.

Want to know if there is any other solution for this? I have also tried copying the "domino_7_0_2.dtd" in the XMLSchemas folder on PI server.

Any suggestion will be appreciated.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi Pragati,

Find the below code. I hope this java code will use full to you.

import java.io.ByteArrayOutputStream;

import java.io.InputStream;

import java.io.OutputStream;

import java.util.Map;

import com.sap.aii.mapping.api.StreamTransformation;

public class RemoveDocMap implements StreamTransformation{

/**

  • @param args

*/

private Map param = null;

public void setParameter(Map param)

{

this.param = param;

}

public void execute(InputStream in, OutputStream out)

{

try

{

OutputStream temp = new ByteArrayOutputStream(1024);

byte[] buffer = new byte[1024];

for (int read = in.read(buffer); read > 0; read = in.read(buffer))

temp.write(buffer, 0, read);

String payload = temp.toString();

int ind1 = payload.indexOf("<!DOCTYPE ");

if(ind1 > 0 && (payload.indexOf("<!DOCTYPE database SYSTEM \"xmlschemas/domino_7_0_2.dtd'\">") >1))

{

int ind2 = payload.indexOf(".dtd\">" )+6;

String sub = payload.substring(ind1,ind2);

payload = payload.replaceAll(sub, "");

}

else if(payload.indexOf("<!DOCTYPE database >")>1){

payload = payload.replaceAll("<!DOCTYPE database >", "");

}

out.write(payload.getBytes());

}

catch(Exception e){

}

}

}

Regards,

Naga.

Shabarish_Nair
Active Contributor
0 Kudos

removing that line is the easiest solution

you can also refer Note 812966 - <!DOCTYPE Declaration (DTD) in the XI mapping

it talks about how to handle this

Former Member
0 Kudos

Hi Vijay,

I have the same problem...

I got the java code from the OSS Note..

I have imported the jar into PI.

When i try to use the class file into Operation mapping, it shows 2 class files...i tried to use one, its giving linkage error..

Can you please suggest me how to use that...

Thanks,

Madhu