Web Service between different NAV

GonzaloGonzalo Member Posts: 19
Hi Experts,
I've two different clients both in NAV 2016, in one of them I've publised a codeunit with just a function (this function is set Local = NO). And from the other client, I want to call that web service and get a decimal. (also I want to set some parameters to that function)
In .NET is pretty easy (I'm able to see the function adding the reference), but from NAV how in earth do I create that url in order to access to that function??
I tried something like that, but it doesn't work: http://ipserver1:8147/DynamicsNAV90/WS/CHRONUS/Codeunit/test/functiontest?param1=1000.

Thanks

Answers

  • massimopasqualimassimopasquali Member Posts: 82
    Hi Gonzalo, I have to developer the same thing, but I have NAV2013. What do you think if we try to developer, togheter, a solution?

    I have made a research and I have found that is possible only to do a DLL the should be work like a proxy, using a service WCF - channelfactory.

    Please, contact me here or by mail massimo@pasqualinfomatica.com

    thank you
  • vaprogvaprog Member Posts: 1,140
    edited 2015-12-11
    You have to pass parameters as a SOAP request, i.e. you have to POST an XML document adhering to the SOAP specification and the WSDL of the published web service to its url.

    There are many examples on the net. Please search for it.

    You can either create an assembly and use this, as @massimopasquali suggested, or you can do it using some Dotnet objects from within C/AL.
  • massimopasqualimassimopasquali Member Posts: 82
    Hi Vaprog your idea its interested, can you give us an example about you have suggested before : "You have to pass parameters as a SOAP request, i.e. you have to POST an XML document adhering to the SOAP specification and the WSDL of the published web service to its url."
  • GonzaloGonzalo Member Posts: 19
    Yeah, Vaprog we would be very pleased if you give us an example.
    Thanks
  • Remco_ReinkingRemco_Reinking Member Posts: 74
    you can find an example in codeunit 248 "VAT Lookup Ext. Data Hndl" in NAV2016. It is using a webservice call to validate a VAT-number.
  • GonzaloGonzalo Member Posts: 19
    Thanks Remco, that is exactly what I'm looking for
Sign In or Register to comment.