WebServices.ServiceBrokerException

saju007saju007 Member Posts: 7
i try with codeunit 12 and published.. and checked thru internet explorer.

localhost:7047DynamicsNAV/WS/CRONUS_International_Ltd/services

working fine and list "GenJnlCodeLine " but

localhost:7047DynamicsNAV/WS/CRONUS_International_Ltd/CodeUnit/GenJnlCodeLine

then face issue.

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;
<s:Body>
<s:Fault>
<faultcode xmlns:a="urn:microsoft-dynamics-schemas/error">
a:Microsoft.Dynamics.Nav.Service.WebServices.ServiceBrokerException
</faultcode>
<faultstring xml:lang="en-US">
Parameter newGLReg of the type INavRecordHandle in method GetGLReg in service GenJnlCodeLine is invalid!
</faultstring>
<detail>
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/"&gt;
Parameter newGLReg of the type INavRecordHandle in method GetGLReg in service GenJnlCodeLine is invalid!
</string>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>

Comments

  • vremeni4vremeni4 Member Posts: 323
    Hi,

    The Codeunit 12 is not intended to be exposed as a Web Service.
    You will need to write your own Codeunit which then uses codeunit 12.
    Your own codeunit can be then exposed as a web service.

    The reason for this is that Methods (Functions) in NAV exposed as Web service do not support "Record" as a parameter.
    If you look at the codeunit 12 and function
    GetGLReg(VAR NewGLReg : Record "G/L Register")
    NewGLReg := GLReg;
    
    The variable NewGLReg is passed as a "Record" from "G/L Register" table.
    This is not allowed.

    I hope this helps.
Sign In or Register to comment.