on 09-26-2013 3:48 AM
Hi
We are using the CIDX adapter in PI 7.3 dual stack for sending ChemXMLs to partner.
We are not sending the reference to the DTD for Preamble and ServiceHeader part:
Partner is expecting Preamble header as below:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE Preamble SYSTEM "PreamblePartMessageGuideline.dtd">
<Preamble><DateTimeStamp>20130925T090131.599Z</DateTimeStamp><GlobalAdministeringAuthorityCode>CIDX</GlobalAdministeringAuthorityCode><GlobalUsageCode>Production</GlobalUsageCode><VersionIdentifier>1.1</VersionIdentifier></Preamble>
We are able to send as below:
<?xml version="1.0" encoding="UTF-8"?><Preamble><DateTimeStamp>20130925T090131.599Z</DateTimeStamp><GlobalAdministeringAuthorityCode>CIDX</GlobalAdministeringAuthorityCode><GlobalUsageCode>Production</GlobalUsageCode><VersionIdentifier>1.1</VersionIdentifier></Preamble>
As per my understanding, we are not mapping anything for this header. This gets created automatically.
Is there something I forgot to set up? Where I have to give the reference of PreamblePartMessageGuideline.dtd ?
Please help me.
Thanks,
Rama.
Hello Rama,
Check the note 1382040 DOCTYPE inclusion in Preamble and Service headerCIDX adapter. Maybe this will help you resolve the error.
Regards
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rama,
If you are using as wsdl in your service interface, you can include a targetnamespace there. This should include that xml tag in your output.
Hope it helps.
Abhishek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rama,
I guess you have a OM/IM in your scenario.In the OM try adding this java mapping code (below message mapping) which includes the missing part.
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import com.sap.aii.mapping.api.AbstractTransformation;
import com.sap.aii.mapping.api.TransformationInput;
import com.sap.aii.mapping.api.TransformationOutput;
import com.sap.aii.mapping.api.StreamTransformationException;
public class CIDXHeaderAdd extends AbstractTransformation {
public void execute(InputStream in, OutputStream out)
throws StreamTransformationException {
try
{
BufferedReader br=new BufferedReader(new InputStreamReader(in));
String s="",data="";
StringBuilder sb = new StringBuilder();
int i,j=0;
while(2>1)
{
s=br.readLine();
if(s==null)
{
break;
}
sb=sb.append(s);
}
data=sb.toString();
i=data.indexOf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
if(i>=0)
{
j=i+"<?xml version=\"1.0\" encoding=\"UTF-8\"?>".length();
}
s="<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+"<!DOCTYPE Preamble SYSTEM \"PreamblePartMessageGuideline.dtd\">"+
data.substring(j);
out.write(s.getBytes("UTF-8"));
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
@Override
public void transform(TransformationInput arg0, TransformationOutput arg1)
throws StreamTransformationException {
// TODO Auto-generated method stub
this.execute(arg0.getInputPayload().getInputStream(), arg1.getOutputPayload().getOutputStream());
}
}
Also attached the jar file in case you need it.
Try this and lets hope error resolves.
Regards
Anupam
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.