Skip to Content
author's profile photo Former Member
Former Member

Could not parse XMBMessage due to Can't parse the document

*Dear all,*

*i have a SOAP to RFC Scenario. XML Validation by Adapter is turned on in SenderAgreement.*

*XSD Files are placed in the correct directory. Incoming requests are validated. However,*

*it seems that responses produce an error in the soap adapter.*

*This is the error message i am getting:*

+SOAP:Fault>+

+<faultcode>SOAP:Server</faultcode>+

+<faultstring>Server Error</faultstring>+

+<detail>+

+ http://sap.com/xi/WebService/xi2.0">+

+<context>XIAdapter</context>+

+<code>ADAPTER.JAVA_EXCEPTION</code>+

+<text>com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Could not parse XMBMessage due to Can't parse the document+

+ at com.sap.aii.adapter.soap.ejb.XISOAPAdapterBean.process(XISOAPAdapterBean.java:1173)+

+ at sun.reflect.GeneratedMethodAccessor678.invoke(Unknown Source)+

+ at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)+

+ at java.lang.reflect.Method.invoke(Method.java:592)....+

*In SXMB_MONI my response includes the following passages*

+- <!-- ************************************+

-->

+<Trace level="3" type="T">Pipeline Service = PLSRV_XML_VALIDATION_RS_OUT</Trace>+

+<Trace level="3" type="T">Skip Inbound Validation =</Trace>+

+<Trace level="3" type="T">Skip Outbound Validation =</Trace>+

+<Trace level="3" type="T">Area = XML_VALIDATION_OUT</Trace>+

+<Trace level="1" type="T">Reading sender agreement</Trace>+

+<Trace level="3" type="T">Validation Mode = Validation by Adapter</Trace>+

+<Trace level="1" type="T">Outbound validation of response takes place</Trace>+

+<Trace level="3" type="T">Interface Name = SI_xxx_xxx_xxx_Sync_Outbound</Trace>+

+ Interface Namespace = http://xxx.de/xxx>+

+<Trace level="3" type="T">Software Component Version = D390B9E10A6B11DF8C15C7540A484C06</Trace>+

+<Trace level="2" type="T">Java Validation Service Call</Trace>+

+<Trace level="1" type="T">System error occurred during XML validation</Trace>+

+<Trace level="1" type="E">CL_XMS_PLSRV_VALIDATION~ENTER_PLSRV</Trace>+

+</Trace>+

+<Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_TO_PERSIST" />+

+- <!-- ************************************+

-->

+<Trace level="3" type="T">Persisting message Status = 023</Trace>+

+<Trace level="3" type="T">Message version 009</Trace>+

+<Trace level="3" type="T">Pipeline CENTRAL</Trace>+

+</SAP:Trace>+

*I see the following error message:*

+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>+

+- <!-- Aufruf eines Adapters+

-->

- http://sap.com/xi/XI/Message/30" xmlns:SOAP=" http://schemas.xmlsoap.org/soap/envelope/">

<SAP:Category>XIServer</SAP:Category>

<SAP:Code area="XML_VALIDATION_OUT">CX_XMS_SYSERR_VALIDATION</SAP:Code>

<SAP:P1>Schema xxx.response.xsd not found in J:\usr\sap\xxx\SYS\global\xi\runtime_server\validation\schema\00000000000000000000000000000000\ u00D3u00B9u00E1 k u00DFŒ u00C7T HL \SI_xxx_xxx_xxx_Sync_Outbound\urnsap-comdocumentsaprfc~functions\xxx.response.xsd (J:\usr\sap\xxx\SYS\global\xi\runtime_server\validation\schema)</SAP:P1>

<SAP:P2 />

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText>not used at the moment.</SAP:AdditionalText>

<SAP:Stack>System error occurred during XML validation</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

There seems to be an error in the adapter trying to validate the response. Does anyone has a clue as to why ?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 14, 2011 at 08:35 AM

    Hi,

    <SAP:P1>Schema Z_HE_FREIGABE_KASSE.response.xsd not found in

    your error message clearly indicate that XSD not fond in the specified path

    J:usrsapxxxSYSglobalxi
    untime_servervalidationschema 0000000000000000000000000000000 Ӑ¹á k ߌ ÇT HL SI_xxx_xxx_xxx_Sync_Outboundurn~sap-com~document~sap~rfc~functionsxxx.response.xsd

    Please make sure that it is available

    Also see the doc for details

    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d026d253-3108-2c10-69a0-a5460fc1f0b9?quicklink=index&overridelayout=true

    Expand the Schema folder in RHS. Select the relevant SCW and Interface Name.
    <SAP installation directory>/<system id>/<instance number>/j2ee/cluster/server0/validation/schema/<GUID of software component version to which Service Interface is assigned>/<Repository Namespace of Service Interface>
    It is to be noted that the folder where exported schema needs to be saved (i.e. RHS) the folder should be like urn~VisaDetailsUpdateRequest

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Since i cannot get i running, i helped myself using a java mapping, that i packaged into a jar

      along with the xsd files. See code below:

      import com.sap.aii.*;
      
      import java.io.File;
      import java.io.FileInputStream;
      import java.io.FileNotFoundException;
      import java.io.FileOutputStream;
      import java.io.IOException;
      import java.io.InputStream;
      import java.io.BufferedReader;
      import java.io.OutputStream;
      import java.io.OutputStreamWriter;
      import java.io.UnsupportedEncodingException;
      
      import java.io.InputStreamReader;
      import java.io.Reader;
      
      import javax.xml.transform.sax.SAXResult;
      import javax.xml.transform.sax.SAXSource;
      import javax.xml.transform.stream.StreamSource;
      import javax.xml.validation.Schema;
      import javax.xml.validation.SchemaFactory;
      import javax.xml.validation.Validator;
      
      import org.xml.sax.InputSource;
      import org.xml.sax.SAXException;
      
      @SuppressWarnings("unused")
      public class CustomValidator extends AbstractTransformation {
      
      	public void transform(TransformationInput arg0, TransformationOutput arg1)
      			throws StreamTransformationException {
      		Validator validator;
      		InputStreamReader insr;
      		String inputPayloadString;
      		try {
      
      			// Trace
      			getTrace().addInfo("com.xxx.pi.mapping.validation.CustomValidator called");
      
      			InputStream inputPayloadStream = arg0.getInputPayload()
      					.getInputStream();
      			insr = new InputStreamReader(inputPayloadStream);
      	
      			InputHeader inpHeader = arg0.getInputHeader();		
      
      			String intfName = inpHeader.getInterface();
      			
      			getTrace().addInfo("Interface Name is :" + intfName);
      			
      			String xsdName = "";
      			if (intfName
      					.equalsIgnoreCase("SI_xxx_Sync_Outbound")) {
      				xsdName = "Z_xxx.xsd";
      			}
      			if (intfName.equalsIgnoreCase("SI_xxx")) {
      				xsdName = "Z_xxx.xsd";
      			}
      			if (intfName
      					.equalsIgnoreCase("SI_xxx_Sync_Outbound")) {
      				xsdName = "Z_xxx.xsd";
      			}
      			if (intfName
      					.equalsIgnoreCase("SI_xxxx_Sync_Outbound")) {
      				xsdName = "Z_xxx.xsd";
      			}
      			
      			getTrace().addInfo("Using schema: " + xsdName);
      
      			if (xsdName.equals(""))
      				throw new StreamTransformationException("Schema für "
      						+ intfName + " nicht gefunden.");
      
      			BufferedReader reader = new BufferedReader(new InputStreamReader(
      					getClass().getResourceAsStream(
      							"/com/xxx/pi/mapping/xsd/" + xsdName)));
      
      			// prepare document validator:
      			String schemaLang = "http://www.w3.org/2001/XMLSchema";
      			SchemaFactory jaxp = SchemaFactory.newInstance(schemaLang);
      			Schema schema = jaxp.newSchema(new StreamSource(reader));
      
      			validator = schema.newValidator();
      
      		} catch (SAXException saxe) {
      			throw new StreamTransformationException(saxe.getMessage());
      		}
      
      		// validate
      		try {
      
      			SAXSource source = new SAXSource(new InputSource(insr));
      			validator.validate(source);
      		} catch (Exception e) {
      			getTrace().addInfo(e.getMessage());
      			String trace = e.getMessage();
      			throw new StreamTransformationException(trace, e.getCause());
      		}
      		// Write the response
      		try {
      			inputPayloadString = convertStreamToString(arg0.getInputPayload()
      					.getInputStream());
      
      			arg1.getOutputPayload().getOutputStream()
      					.write(inputPayloadString.getBytes("UTF-8"));
      			
      			getTrace().addInfo("Schema Validierung erfolgreich !");
      		} catch (Exception e) {
      			throw new StreamTransformationException(e.getMessage());
      		}
      
      	}
      	
      	
      	// helper to convert to String
      	private static String convertStreamToString(InputStream in) {
      		StringBuffer sb = new StringBuffer();
      		try {
      			InputStreamReader isr = new InputStreamReader(in);
      			BufferedReader reader = new BufferedReader(isr);
      
      			String line;
      			while ((line = reader.readLine()) != null) {
      				sb.append(line);
      			}
      
      		}
      
      		catch (Exception exception) {
      		}
      		return sb.toString();
      	}

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.