Webservice issues (multiple)

Miklos_Hollender
Member Posts: 1,598
I'm messing with a codeunit-based web service, managed to get to this stage:
(This is in the WSDL page opened in the browser).
I've recompiled, republished, restarted both services, still the same... any ideas?
I got this point by trying to somehow be able to return strings longer than 1024 chars from the webservice codeunit. So I was trying stuff like using a VAR parameter of a BigText type (as a return type cannot be a BigText) and other similar tricks and it just happened. Restoring it to the original (the capitalize example) and recompile/republish/restart didn't help.
Which brings us to the second topic - what's the best way to return more than 1024 chars? I think the VAR parameter of BigText type sounds promising, but perhaps that's what broke it.
<faultcode xmlns:a="urn:microsoft-dynamics-schemas/error">a:Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLMetadataFailedException</faultcode> <faultstring xml:lang="en-GB">Metadata for object of type CodeUnit with id 50000 is in a failed state. This is caused by a previous exception: Could not find a part of the path 'C:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit50000.cs'.</faultstring> - <detail> <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Metadata for object of type CodeUnit with id 50000 is in a failed state. This is caused by a previous exception: Could not find a part of the path 'C:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\source\Codeunit\Codeunit50000.cs'.</string>
(This is in the WSDL page opened in the browser).
I've recompiled, republished, restarted both services, still the same... any ideas?
I got this point by trying to somehow be able to return strings longer than 1024 chars from the webservice codeunit. So I was trying stuff like using a VAR parameter of a BigText type (as a return type cannot be a BigText) and other similar tricks and it just happened. Restoring it to the original (the capitalize example) and recompile/republish/restart didn't help.
Which brings us to the second topic - what's the best way to return more than 1024 chars? I think the VAR parameter of BigText type sounds promising, but perhaps that's what broke it.
0
Comments
-
The error you are seeing actually comes from service tier. The WebService windows service communicates with NavServer. So for some reason your Codeunit is not translated into c sharp and so service tier does not have the codeunit.
As far passing strings longer than 1024, yes you can use bigtext as parameter and pass it by reference (VAR).
Webservice will return the parameter back to the caller.0 -
You should try and restart the Service tier. Also delete all the records from Object Tracking table first and then restart the Navservice and Nav WebService0
-
http://blogs.msdn.com/freddyk/archive/2008/11/23/search-in-nav-2009-part-1-out-of-3.aspxcontains an example on how to return a large string trough a web service.Freddy Kristiansen
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.0 -
There is a key in the customsettings.config file called WebServicesMaxMsgSize. It is actually a WCF setting. By default it is set to 512k. Increasing this and restarting the service should allow a larger data packet to be sent.Tom Cornelius
Test Lead
Microsoft Dynamics NAV
This posting is provided "AS IS" with no warranties, and confers no rights.0 -
I fixed it, but I don't exactly know how. Point is, I didn't have a MicrosoftDynamicsNavServer directory under the C:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server.
Now, I've restarted both services a couple of times, using the normal "Restart" menu item, but what happened now that I stopped both fully. And then I just started the NAV Service but not the Business WebService. And it created these directories.
Although I never seen a .cs file in them, even though I modified and recompiled the codeunit, it started to work. Interesting.
My guess is that the MicrosoftDynamicsNavServer subdirectory and all those under it in ProgramData are deleted at some point and a simple restart of the server service does not recreate it, perhaps because the business webservice service is running too. Stopping both and starting the nav service recreates it. Strange.0 -
Oh! I just fund that if I use an XMLPort as a VAR parameter to pass stuff back to the code that called the webservice, like in http://blogs.msdn.com/freddyk/archive/2 ... stuff.aspx
I can't pass that XMLPort on to another function as yet another VAR Parameter to construct it in that function, it has to be constructed in the original one, because it says assignment is not allowed.
That's not very handy when there are 50 little functions in the web service that I intendeded to write as one-liners, calling one general function with different parameters... :-/0 -
You should use BigText as parameter and stream it into a local variable xmlport.0
-
ara3n wrote:You should use BigText as parameter and stream it into a local variable xmlport.
Hand-writing all the XML's?... Oh... wait, I think I know what you mean. Function 1 is exposed to the web service with a ByRef XMLPort. It calls Function 2 giving a BigText ByRef parameter. Function 2 calls Function 3 giving in the same BigText the same way. Function 3 instantiates an XMLPort, streams it into the BigText, and it goes all the way back to Function 1 which streams the BigText back into the XMLPort. OK, I think that can be done. I think I should try it and blog it0 -
Correction: it must be a temptable on the TempBlog record: - BigText cannot CREATEOUTSTREAM.0
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