AIF Inbound Port with multiple services

I need to process an XML file that contains both customers and invoices.

So my Inbound Port contains both the CustCustomerService.create and the CustFreeTextInvoice.create services. I’ve tried 2 envelopes within the same XML and also 2 lots of Header and Body within the same Enevelope but I just get invalid schema.

Individually they both work ok.

How do I get this to work? Is it even possible?

Thanks

One endpoint can offer several service operations, but you can’t just give it one message and hope that magic happens and the message will be parsed, split. transformed to new valid SOAP messages and passed to the right operations. You have to provide the right message for each operation (with the right value in Action element and with data corresponding to it).

Thanks for the reply, I thought that might be the case.

I’m getting the XML file from an external system. Is there some sort of tranform that I can perform to get the customer and invoice information out to be processed separately, ideally the customers to be created first?

Yes, you’ll have to transform the file from one format to another. You can use XSLT or basically any other technology capable of working with XML.

Yes, I’m familiar with an XSLT, I’m comfortable with that to transform to an envelope and the right action etc. But I guess I need 2 ports now each receiving the same file, with 1 port creating customers and the other creating invoices?

Hi Robert,

Essentially I note you are trying to expose two different types of data entity i.e. master and transaction along with their associated schema.

If possible, I would publish these as two separate services and get the external system to call them sequentially as required. If this is not possible, try publishing a bespoke service with required schema and internally within AX call the standard services sequentially.

As I said, one endpoint can have many operations. It’s very common.

I just have a standard setup. A Batch job, containing the AIF service tasks, continuously running. The external system will just place/copy the XML file into the Inbound folder of my port.

In other words, you’re using the standard file system adapter. I don’t use it much, but don’t see anything that wouldn’t work. The adapter will load files, without bothering about the content. And the next step will check the Action element and pass the message to the right operation.

Yes, but I can’t create 2 Actions with just 1 file.

I thought we already discussed that. You have to split it to two files, each with its own action and content.