on 06-16-2009 12:55 PM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.