Microsoft Dynamics Nav Post using Web Services - c#

Im trying to Post on Navision using Navision Web Services (using C#) but so far looks impossible, especially since I dont own developer license. But there are some Codeunits like Codeunit 22,23 which are supposed to do the post of Item Journals but I cant seem to make them work and cant find good info about how to do that. Any little help will be much more than appreciated.

If you were trying to publish those codeunits and try post like this then it is not good approach. And "cant seem to make them work" is just not enough to help you.
Most of customer licenses include free objects that can be created and modified w/o dev license. Those should have numbers starting from 50000 in object designer. I would advise you to create and publish codeunit within this range and call it from your application as web service.
In the codeunit you put creating and/or posting of journal lines. Calling posting codeunits from there should be no problem. But choosing of proper codeunit to call heavily depends on what exactly you are trying to post and what results you expect.

Related

SAP: Discover available web services through a web service call?

Sorry for my ignorance on SAP here, this is outside of my wheelhouse a bit and I'm trying to adjust.
As anyone who has worked with SAP knows, there's at least a dozen ways to do anything in the system... which is both good and bad. For what I'm trying to do (consolidate lists of security "items of interest"), it's mostly bad.
We have multiple completely separate SAP instances from various M&A's over quite a long time, and I am trying to find a common way to extract table information (user data and the like) from all of them without installing anything into the system itself. Consuming Web services seem to be the "right" way to do this. At the end of the day, I'd like to pull data from tables like USR02 and compare them against all these instances, looking for commonalities and near-misses that we'll have to investigate further.
What I'd like to know is if there is an SAP web service that I can rely on to tell me what web services are available on the Netweaver platform that I'm connecting to... or, failing that, a "default" web service that I can use to collect table information from whatever SAP table I want (that I have access to, naturally).
When I go to the WebService port in a browser, I get a 404, so I know it's listening... but there doesn't seem to be a directory listing, and I don't know how to find what I'm looking for... and SAP documentation has not been particularly helpful in this regard.
Can someone point me in the right direction?

Separating existing web project

I have inherited an existing .Net/angularJS project. We have a need moving forward to allow customization per client, while still maintaining synchronization through version control (in this case, git).
I'm not a .Net developer--my .Net experience is limited to writing a service a couple of years ago, starting the BrowserStack tests for the project, and the occasional foray for code review type activities. I'm primarily a Flash/Flex developer with a fair amount of ASP Classic and some PHP experience.
My preliminary research seems to indicate that I can do what I need to do with a git subtree, but I need to find where the seams should be to separate out the custom stuff from the shared code. Right now, the HTML and JS are in the same directory as the web services. My first order of business will be to separate those out, but I don't completely understand
Why everything's all in one place to begin with
What the implications are of moving things (project settings, paths, etc.)
When I wrote the service way back, I do remember that we had to scrap the service because the server we had the site on didn't support that version of .Net and it wouldn't work across domains so I could host the service on a server where it would work. I know that things have changed and there's now a way to allow that, but I figure that's the sort of problem I should be looking to avoid as I do this.
I figure I can't be the first person needing to make this kind of separation in a project I think started from the monolithic web project template, but because of a short deadline and a lack of knowledge of .Net, I'd feel better if someone could point me in the right direction or at least alert me to some of the gotchas I should plan to encounter.
Are you Trying to decouple the Projects. If so than this might be a good help.
http://www.codeproject.com/Articles/439688/Creating-ASP-NET-application-with-n-tier-architect
One of my recent project was almost the same that you mentioned above, So I ended up scrapping the old version and Create a brand new Project and Decoupled the related stuffs in the solution.
The best way of understanding stuff is to make sure you seperate the Client Side (Javascript/Htmls/CSS) and Server Side (EF/SP Calls/DTOs etc) by creating different project to the same solution.
Hope this Helps.
So I kept digging, and I finally found a pair of tutorials that address exactly this issue.
Creating an empty ASP.Net Project Powered by Angular JS Using Visual Studio
AngularJS Consuming ASP.NET Web API RESTful Services
In a nutshell, you copy the client's url from the properties panel to the service properties panel and add '/api' to the end of the URL and allow VS to create a virtual directory for you.
Now for my next trick, figuring out how to publish it...

CareerBuilder Job Posting Web Service

So, I got a dev key from CareerBuilder and I am looking to post a job on their site trough their API. However, so far I have only found ways to retrieve job posting based on certain criteria. Is there a way I can post a job on their site given provided information? (preferably using C# unless there is only one way)
CareerBuilder does not publicly expose their job posing API. Posting is about the only thing you cannot do via their API.
You can see all of the exposed endpoints for the API here: http://developer.careerbuilder.com/endpoints/index#collapse4
However, if you want to be able to post a job from CareerBuilder and don't want to use the web site CareerBuilder does offer you some options there.
You can use their Document Post Interface (DPI). Information can be found here: http://dpi.careerbuilder.com/Site/Index.aspx
The DPI will get you what you want but it is completely separate from the API. You will need to talk to your sales rep or account manager if you are interested in posting via the DPI.
If you do not have a sales rep or account manager, you can call their 1-800 number and they can get you the information there.
Unfortunately I don't believe there is a lot of public information about the DPI. I'm a former employee of CareerBuilder and used to work on their DPI and mapping platforms.
UPDATE: Remembered this after posting. You can also email IntegrationSupport#careerbuilder.com to find more information. That email address is more for technical support but they can point you in the right direction.

Application with payment functionality

Could you please refer me to an example of an Asp.Net application that would allow the owner to collect a fee for viewing certain pages content?
I have no idea what to start with. Besides the technical aspect of this question, I don't know where one would get a server to install such an application. Can any computer work as such?
Thanks, and sorry if my question is too naive.
You need to look for payment gateways. They will provide you with an API to call that can process the payments. An example would rely on the payment gateway that you are using as all of them are different.
I'd have a look at Stripe it is quite developer friendly (you won't have to trawl through loads of docs to find out what you want to do) and the rates arn't too bad. They are similar to sagepay (much harder to figure out, out of date)

Building a C# Web API - REST

I am about to start a project in C#. I've never used c# and I was hoping I could get some implementation advice before I make a silly mistake and go down the wrong path.
What I am trying to achieve is basically having a C# application on a server that can be accessed via a Web API. This application will take in some string variables and then return a string. The application will be opening and running some installed programs (not c# programs).
I've read about WCF but I think at first glance this might be overkill as the API I am hoping to create will only have one or two request methods and will return a string.
What I am really looking for is advice on what I should be using, what to look into and even links to good tutorials on building web services with C# and how I can make the link between a web API to a C# app.
Thanks all for any advice.
Skip wcf and asmx. Instead just implement this stuff through generic handlers (.ashx) files.
You have complete control over what comes in and goes out without having to muck around with all the XML garbage. We did this a while back and haven't looked back.
In short, I'd use WCF if my endpoints were going to be something other than the web server. I'd use asmx if I had to deliver all of the responses back as XML AND I was assured only .net clients would be accessing it.
Generic handlers are like .aspx pages but without all of the overhead of the page lifecycle. It gives you get a context object that has access to all of the http post and query string variables and it's up to you to decide what to emit back.
They are simple to implement and have none of the "what was that config setting for again?" issues.
Here are a couple pretty good walkthroughs:
http://swindelles.com/2008/07/11/creating-rest-web-services-in-c-sharp/
http://www.codeproject.com/KB/aspnet/RestServicesInASPNET2.aspx
If you think WCF might be overkill you could implement a simple ASP.NET MVC application that returns data as JSON or XML.
http://omaralzabir.com/create_rest_api_using_asp_net_mvc_that_speaks_both_json_and_plain_xml/
update: Another excellent option is ServiceStack. I've used it and it's really nice to work with.
You could look into vanilla web services. I only briefly glanced at it, but this seems like a decent guide.
You really need to take a look to the WCF Data Services they are easy to implement
http://msdn.microsoft.com/en-us/data/bb931106
I first met them when I implemented the Dino Esposito examples in March 2010 MSDN Magazine
http://msdn.microsoft.com/en-us/magazine/ee336022.aspx
I recommend you first read the Dino Example.
For a simple Web API, WCF is overkill, clunky, operation orientated and designed for SOAP based services (it does Web HTTP, but that was an afterthought).
The new kid on the block is ASP.NET MVC Web API for lightweight web-orientated architectures. Prepare to see more and more of this young upstart.

Categories