Cannot access Newly created Codeunit in Web Service

Deepankar1982
Member Posts: 38
I have created a function named "PostPayment" in a codeunit which accepting Gen. Journal Line as a parameter and after publishing it to the Web Service form with name "Gen_Journal_1", I can get the Service in the WSDL file but when i am going to access that service it's giving an error.
Error in xml format
- <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
- <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 genJrnl of the type INavRecordHandle in method PostPayment in service Gen_Journal_1 is invalid!</faultstring>
- <detail>
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Parameter genJrnl of the type INavRecordHandle in method PostPayment in service Gen_Journal_1 is invalid!</string>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
Please let me know where i am wrong.
With regards,
Deepankar
Error in xml format
- <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
- <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 genJrnl of the type INavRecordHandle in method PostPayment in service Gen_Journal_1 is invalid!</faultstring>
- <detail>
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Parameter genJrnl of the type INavRecordHandle in method PostPayment in service Gen_Journal_1 is invalid!</string>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
Please let me know where i am wrong.
With regards,
Deepankar
0
Comments
-
Hi
If u use Record type variable in parameters in code unit and want to use as web service then u get problem so, do not use record type variable in code parameter unit which u want in web service
:thumbsup:
Ashish Gupta
SS Dynamics Solutions Pvt. Ltd.Ashish Gupta
Navision Technical Consultant0 -
Thanks, for the reply but I am using it during Sales order posting. I have created a function in Codeunit there, I am passing Sales Header as a Parameter and it's working fine.0
-
Yes, it's working fine because you are using the CU as codeunit helper for a Page and when you publish it webservice, the name has to be the same.0
-
Yes, you are correct it's working fine the way you told me.
Can you tell me, one more thing that if we want to return record set or array variables then what method shall we follow ?
With regards,
Deepankar0 -
0
-
ara3n wrote:Yes, it's working fine because you are using the CU as codeunit helper for a Page and when you publish it webservice, the name has to be the same.
What's interesting service name can't contain spaces, otherwise functions from CU will not be added to page methods0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions