Options

SOAP Error Calling a PHP Service inside a NAV Web Service

tranceporttranceport Member Posts: 8
edited 2011-02-15 in NAV Three Tier
Hi,

I have the following scenario:

3rd Party web application using PHP has an external Web Service containing all details required for Navision.
Navision needs to be triggered to call this web service.
I created a NAV Codeunit exposed as a web service so the external web application can call it when an event happens.
In turn this nav codeunit calls the external web service, gets the details and processes.

I am calling the connection in this codeunit as follows:

SOAPConnector.Property('EndPointURL',wsdlurlvar);
SOAPConnector.Connect;
SOAPConnector.Property('SoapAction',urnvalue);
SOAPSerializer.Init(SOAPConnector.InputStream);


This works perfectly when i run the codeunit in the Navision Client. This is happening when the web service is called by the external web application. I am getting the error when the Property setting is reached (in firefox - ie just gives you an http500 error):

SoapFault exception: [a:Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLAutomationInvokeException] This message is for C/AL programmers: The call to member Property failed: Number of parameters specified does not match the expected number.. in

Has anyone ever encountered this?
I would like to see if there is any programming/setup issues before i attempt to change the concept :)

Navision is 2009 SP1 latest build. Note also that i did create a simple codeunit web service without any soap calls (just to test that simple webservices between PHP and Nav works) and this worked fine. The problem is on the PROPERTY method.

Thanks in advance.
TRANCEPORT_

Comments

  • Options
    IsakssonMiIsakssonMi Member Posts: 77
    I guess you need to pass Credentials to the webservice, I guess that's only possible by .NET. Try make a proxy and let the proxy handle the credentials.
  • Options
    jpjesusjpjesus Member Posts: 45
    Hi,
    Did you manage to solve this issue?
    Because I've run into it a few weeks ago and I don't think the RTC client can deal with some characters used on the SOAP tags.
    The exact same XMLport works with the classic client, but it doesn't work when it's called from the RTC client.
  • Options
    jpjesusjpjesus Member Posts: 45
    viewtopic.php?f=32&t=40874&hilit=soap

    According to the reply to my own post, it seems that this is due to a license issue.

    At the moment I am waiting for a reply from Microsoft Portugal on this.
  • Options
    afarrafarr Member Posts: 287
    I am getting the same problem, that is:

    I call a WebService from within Navision, and this works well.
    However, the end-user can go to a website, and call a different function in the same WebService, which then calls the same codeunit as a webservice. However, we are then getting the error message reported below.

    "The call to member Property failed: Number of parameters specified does not match the expected number.. "

    The licence used for now is our development licence, so it doesn't look like a permission issue.
    Alastair Farrugia
  • Options
    afarrafarr Member Posts: 287
    Our approach was:

    Webpage calls WebService1, passing a companyname and other parameters.

    WebService1 retrieves the SalesSetup record from the relevant company; this contains the WSDL (and other details) of WebService2. WebService1 then calls WebService2 which generates a report (from the relevant company).

    Note that WebService1 is called with the same URL, such as
    http://vm-machine:7047/MicrosoftDynamic ... Statements

    However, for WebService2, each company has its own URL, e.g.
    http://vm-machine:7047/MicrosoftDynamic ... Statements
    http://vm-machine:7047/MicrosoftDynamic ... Statements
    http://vm-machine:7047/MicrosoftDynamic ... Statements

    That way, the webpage always used the same URL when calling a Nav webservice.
    However, as noted below, we were getting errors "The call to member Property failed" when using SOAP to call WebService2.

    Fortunately, there is a way to generate a WSDL dynamically in .NET, and thus get the webpage to call WebService2 in the appropriate company, so we don't need WebService1 at all. See David Roys' page below for more details:
    http://www.teachmenav.com/blogs/dave/archive/2009/07/11/using-reflection-to-call-nav-2009-web-services.aspx
    Alastair Farrugia
Sign In or Register to comment.