Skip to Content

Dispatcher within outbound file adapter

Hi,

I am trying to create a file using the outbound file adapter,  the file will contain many record different record types. In order to be able to process these I thought that I would use the dispatcher within the outbound file adapter to call XSLT to transform the XML into the target format. My file adapter configuration is as follows :-

0.1. File adapter java class

classname=com.sap.aii.messaging.adapter.ModuleXMB2File

mode=XMB2FILEWITHCONVERSION

##Adress for XMB endpoint

XMB.httpPort=8350

XMB.httpService=/file/receiver

XMB.ReceiverAdapterForBusinessSystem=CM_Files_Dev

file.targetDir=c:ipp

file.targetFilename=c:ItemInfo.txt

file.writeMode=overwrite

##xml conversion properties if mode XMB2FILEWITHCONVERSION is specified

xml.addHeaderLine=0

xml.fieldFixedLengths=6,1,1

xml.fixedLengthTooShortHandling=Cut

Dispatcher.class=com.sap.aii.messaging.adapter.ConversionDispatcher

Dispatcher.namespace=namespace1

namespace1.ConversionDispatcher.logPayload=true

namespace1.Service.1=Plain2XMLService

namespace1.Plain2XMLService.class=com.sap.aii.messaging.adapter.Conversion

namespace1.Plain2XMLService.xml.conversionType=SimpleXML2Plain

#namespace1.Plain2XMLService.xml.addHeaderLine=0

#namespace1.Plain2XMLService.xml.fieldFixedLengths=6,1,1

#namespace1.Plain2XMLService.xml.fixedLengthTooShortHandling=Cut

namespace1.Service.1=XSLTService

namespace1.XSLTService.class=com.sap.aii.messaging.adapter.XSLTConversion

namespace1.XSLTService.XSLTConversion.XSLTFilename=ItemInfo.xsl

When I send a message to this file adapter the XML message displays the following message :-

System Error

Code: HTTP.HTTP_STATUS_CODE_NEQ_OK

HTTP status code 500 : Internal Server Error:Error converting Message

Description

No description exists for this system error.

The adapter trace file contains the following messages :-

Jan 7, 2004 4:11:46 PMÂ Â Â ...p.aii.messaging.net.HTTPRequest.run() Error: com.sap.aii.messaging.net.TransportException: HTTP 500 Internal Server Error:Error converting Message

at com.sap.aii.messaging.adapter.XMB2FileProcessor.persistFile(ModuleXMB2File.java:1419)

at com.sap.aii.messaging.adapter.XMB2FileProcessor.onMessage(ModuleXMB2File.java:1026)

at com.sap.aii.messaging.adapter.ModuleHttpServer$ListenerDetails.onMessage(ModuleHttpServer.java:435)

at com.sap.aii.messaging.net.HTTPRequest.run(ServerHttpImpl.java:442)

Does anyone have any idea what this message means?  Has anyone else come up with the problem of trying to create many record types within the outbound file adapter. If so how have you done this.

Thanks in advance

Ian

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • author's profile photo
    Former Member
    Posted on Jan 16, 2004 at 06:39 PM

    Hi Ian,

    you can go this way to create a multiple type of record with an outbound file adapter. Ther error Message i don't understand but first i saw that your specify the number of the service twice.

    Your should specify like this

    1. First Dispatcher Service

    namespace1.Service.1=Plain2XMLService

    namespace1.Plain2XMLService.class=com.sap.aii.messaging.adapter.Conversion

    namespace1.Plain2XMLService.xml.conversionType=SimpleXML2Plain

    1. Second Dispatcher Service

    namespace1.Service.2=XSLTService

    namespace1.XSLTService.class=com.sap.aii.messaging.adapter.XSLTConversion

    namespace1.XSLTService.XSLTConversion.XSLTFilename=ItemInfo.xsl

    Mybe this is the problem. Try this first out.

    Here is my example of chaining Dispatcher Services:

    1. Eigene Java-Exit: XML liegt noch hierarchisch vor. Diese Hierarchie wird flach gelegt.

    Man.Service.1=StructXML2PlainService

    Man.StructXML2PlainService.class=de.man.mn.sap.adapterExtension.Hier2Flat

    Man.StructXML2PlainService.xml.documentName=MTAuftrag

    Man.StructXML2PlainService.xml.recordsetName=row

    Man.StructXML2PlainService.xml.recordsetStructure=Kopf,1,Position,*

    1. Dispatcher Service von SAP: Konvertiert von einer flachen XML-Struktur in zeilenweise

    2. Darstellung. Das Trennzeichen wird auf ein nicht druckbares Zeichen gesetzt, da dieses

    3. sehr unwahrscheinlich als Dateninhalt in der Nachricht vorkommen duerften.

    Man.Service.2=SimpleXML2PlainService

    Man.SimpleXML2PlainService.class=com.sap.aii.messaging.adapter.Conversion

    Man.SimpleXML2PlainService.xml.conversionType=SimpleXML2Plain

    Man.SimpleXML2PlainService.xml.addHeaderLine=0

    Man.SimpleXML2PlainService.xml.fieldSeparator='0x1D'

    1. Eigene Java-Exit: Ersetzt das Trennzeichen '0x1D' und ersetzt es durch einen Blank.

    Man.Service.3=RemoveSeparatorService

    Man.RemoveSeparatorService.class=de.man.mn.sap.adapterExtension.RemoveSeparator

    I did it with Java. But with XSLT it should also be possible. By the way this do the thins you

    want. It's create different record type.

    cheers.

    Ly-Na Phu

    Add comment
    10|10000 characters needed characters exceeded