Reading MSMQ message with XMLPort.Import

kostratkostrat Member Posts: 2
Hello all,

I am working on an integration project involving Navision 4.0.
I am sending an MSMQ message of the following form (contains non english characters)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Customers>
	<Customer>
		<No.>888888</No.>
		<Name>Kostas Stratelos</Name>
		<Address>612 South Sunset Drive</Address>
		<Address2/>
		<City>Miami</City>
		<PhoneNo/>
		<TerritoryCode>ΕΞΩΤΕΡΙΚΟΥ</TerritoryCode>
		<CreditLimitLCY>0</CreditLimitLCY>
		<CustomerPostingGroup>ΕΞΩΤΕΡΙΚΟΥ</CustomerPostingGroup>
		<CurrencyCode>USD</CurrencyCode>
		<LanguageCode>ENU</LanguageCode>
		<PaymentTermsCode>1M(8D)</PaymentTermsCode>
		<SalespersonCode>JR</SalespersonCode>
		<ShipmentMethodCode>ΕΣΑ</ShipmentMethodCode>
		<CountryCode>US</CountryCode>
		<LocationCode>ΚΙΤΡΙΝΟ</LocationCode>
		<VATBusPostingGroup>ΕΞΑΓΩΓΕΣ</VATBusPostingGroup>
		<E-Mail>spotsmeyer's.furnishings@cronuscorp.net</E-Mail>
	</Customer>
</Customers>
to a queue and use the following code


OnRun()
CREATE(MQBus);
CREATE(CC2);
CREATE(XMLDom);
CC2.AddBusAdapter(MQBus, 1);
MQBus.OpenReceiveQueue('.\private$\toNavision', 0, 0);

CC2::MessageReceived(VAR InMessage : Automation "''.IDISPATCH")
InMsg := InMessage;
InS := InMsg.GetStream();

// open the response queue and create a new message
MQBus.OpenWriteQueue('.\private$\fromNavision', 0, 0);
OutMsg := CC2.CreateoutMessage('Message queue://.\private$\fromNavision');
OutS := OutMsg.GetStream();

XMLPORT.IMPORT(55002, InS);

OutS.WRITE('Finished import');
OutMsg.Send(0);

to read it in and create this customer. 55002 is the corresponding XMLPort.
It does not work.

When I read the same xml from a regular file it works fine.
Any suggestions?

Best regards,
Kostas
Sign In or Register to comment.