I have a codeunit in NAV2009, exposed as a web service, which contains a number of functions to handle SOAP messages from an external application. Each function corresponds to a different XML message which are handled by XML ports.
PROCEDURE StockBalanceMessage@1000000000(VAR stockBalances@1000000000 : XMLport 50001) OK : Boolean;
BEGIN
OK := stockBalances.IMPORT;
COMMIT;
END;
This works fine under testing until the XML supplied by the external application included namespaces in the elements of the XML message. I have seen other posts on the forum talking about stripping out the namespace before passing it to the XMLport, but how can I get the inbound XML message before it is passed to the XMLport?
Any suggestions ?
Comments
http://www.sist.biz/en/ [en] | http://www.sist.biz [de]
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Thanks for the reply, but the supplier is picking up the WSDL as exposed by NAV, and formatting their messages according to this. NAV then objects when it finds the namespace prefixed to the elements.
We also have the added problem where the supplier thinks they are the more important member of the partnership, and want to shift the resolution of the problem to NAV, this means we would need to be able to access the raw message as it is supplied, and strip out the namespace - something which it appears is not possible.
You know, WSDL is sometimes named as "Contract", and if someone takes it, and do not follow it, he cannot use the webservice... in this case another way must be created, own webservice for such a partner, or some Proxy, translating the calls to the standard calls following the contract. It should be easy to create such a proxy if you know c# or something else from .NET world.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Thanks Kine. I appreciate the replies. I am struggling to get the supplier to accept what he is being told, so might need to consider other options, such as you suggest. But this adds to the NAV workload, when the problem really lies at the supplier.
http://www.sist.biz/en/ [en] | http://www.sist.biz [de]
Thanks SiSt. I am awaiting a response from the other party, but this is the route I am thinking I might need to take. I have not tried this approach before. Do you have any examples that I could take a look at?
http://www.sist.biz/en/ [en] | http://www.sist.biz [de]
I am quite comfortable with the writing the requests into NAV, but have never created any web services in C#, and was just looking for a quick starting point.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.