cXML PunchOut Transaction and Javascript - javascript

I am researching how to PunchOut enable a webstore and from what I read, I have to use a server side language. Unfortunatly I am limited to only using Javascript. Can this be done? Does anyone have any best practices or can point me to a reference for enabling a PunchOut ecommerce store by only using Javascript?

According to the cXML Users Guide (http://xml.cxml.org/current/cXMLUsersGuide.pdf) on page 23 it states "PunchOut catalogs are made possible by Web server
applications, written in a programming language such as ASP (Active Server Pages),
JavaScript, or CGI (Common Gateway Interface), that manage buyers’ PunchOut
sessions.". Based on that it sounds possible as they call out JavaScript, but they also call out the fact that it is done by Web server applications. I have not used a strictly JavaScript myself, just ASP and recently .NET.
However, I'm not a JavaScript expert so YMMV. The main thing to keep in mind that most punch-outs (especially from Ariba) will be initiated via an HTTP POST with the cXML document XML as a form value. If you can use JavaScript to process that XML and send back a response without server side work, then you should be good to go.

Related

Can AJAX and JavaScript be used purely for server side scripting?

I am just learning php. My approach to learning is that I start analysing the code in a language I am more familiar with.
Hence, I am trying to replicate a PHP dashboard with PHP features like role management, session logging etc.
As I am halfway through it, I find that using ajax , though not primarily meant for it, I can talk to a server.
Using Http verbs, I can also make modifications.
Hence, can JavaScript and Ajax together act as a server side scripting language on its own?
My understanding is a server side scripting language just interacts with the server.
As ajax does the same using JavaScript and http verbs .
Can it essentially replace PHP?
I did a little research, and found server side scripting languages have their own pros like filtering, jQuery and Ajax can use less bandwidth etc.
But everything seems vauge.
Hoping to get a better understanding.
Thank you:)
Server side scripts run at the server, not at the "client" (browser). Javascript run at the browser. Ajax is a feature of JS that allow you to interact with a server without doing a full POST back to that server (changing the page you are actually seeing). During an AJAX call you can interact with whatever is on the server side (PHP, .NET, etc) There are even some sites that have multiple server side scripts.

How to add html/js query to gwt app using gwt-rpc?

We have a web client built with GWT that talks to a server via gwt-rpc. One part of the app will now use html/js to replace the GWT GUI and we want that part to talk to the server but not via gwt-rpc. What ways are there to migrate a gwt-rpc call to something that will work with a none a gwt client? Today we send and receive java collections that contain object graphs like a list of order objects that have them self order detail objects and so on.
Thanks
Your best bet is using REST. Your data is sent using JSON, which is part of JavaScript so it will always be understood on the client-side. On the server side there shouldn't be any problems finding a suitable library to handle the rest (ha-ha, get it?).
If you're using GWT on the client and server side for now, resty-gwt and Jersey are a popular combo. There was a talk about it on the last GWT.create conference, it's a good starting point.

Hiding Parse javascript SDK files and blocking client from running js

I'm working on a Parse web app and have run into some problems using the backbone.js based client side javascript sdk. I noticed the way I have things set up, the client can view all of my source code by simply using the dev tools to view source files and can also run code against the database (within the limits of the ACL's I've set). I've started working on rebuilding the app in cloud code using the Express.js module Parse provides so that all of my code is stored server side, but I was wondering how those using client side frameworks get around this obvious problem.
That's the issue with client-side code. Assume any code you send to the client is hacked, broken, and tampered with.
With JavaScript, your best bet is to use either Cloud Code and send AJAX or streaming data calls to the server, retrieve the data from the server at runtime (not super secure, but would fool some people), or accept that your code is vulnerable.
I typically work with frameworks in the MVC format, so I only expose a limited subset of the actual model via a REST API. I use both a client-side framework and a server-side framework. Any thing sensitive goes on the server.

Client side scripting and Server side scripting languages

What scripting languages comes under client side and what and all comes under server side?
If JavaScript is scripting language, then what about jquery. jquery is nothing but javascript library rite? so jquery is client side scripting?
I goggled it, but its still confusing. In some sites its given, client side scripting are JavaScript and vb script and in some other sites its saying only JavaScript. In case of server side, they are mentioning html also.
Can i have a clear idea about this.
Client Side:
Scripts that execute in client side. In context of websites, it is scripts that execute in the browser of the user.
Eg: Javascript, VB etc.
(JQuery, DOJO are libraries build on top of Javascript so it is also client side.)
Server Side:
Scripts that execute in the Server. In context of website, it is scripts that execute on application servers.
Eg: PHP, Python, Ruby etc
We cannot classify languages as client side or server side. There could be a scenario where a server can execute Javascript and render HTML from it. In this context Javascript becomes a server side lanuage. I hope I did not confuse you.
What scripting languages comes under client side
For all practical purposes: JavaScript
and what and all comes under server side?
Every programming language under the sun (including JavaScript)
If JavaScript is scripting language, then what about jquery. jquery is nothing but javascript library rite? so jquery is client side scripting?
It is a library. Yes. Generally … it is geared very heavily towards the browser, but (in theory at least) you could use it with something like PhantomJS for manipulating webpages on the server.
I goggled it, but its still confusing. In some sites its given, client side scripting are JavaScript and vb script and in some other sites its saying only JavaScript. In case of server side, they are mentioning html also.
Internet Explorer (although prossibly only older versions) also supports VBScript for client side programming. Using it isn't practical on the WWW since it doesn't run anywhere else.
Quoted with minor formatting changes from user61852's answer
"Here I will talk only about web programming.
Client side programming has mostly to do with the user interface, with which the user interacts. In web developing it's the browser, in the user's machine, that runs this code, and is mainly done in javascript, flash, etc. This code must run in a variety of browsers.
Its main tasks are:
validating input
animation
manipulating UI elements
applying styles
some calculations are done when you don't want the page to refresh so often
The person in charge of front end programming must know:
javascript
css
HTML
basic graphic design
Ajax
maybe Flash
some 3rd party javascript libraries like JQuery
UI design
information design, etc.
Server side programming has to do with generating dynamic content. It runs on servers. Many of these servers are "headless". Most web pages are not static, they search a database in order to show the user updated personalized information. This sides interacts with the back end, like say, the database.
This programming can be done in a lot of languages:
PHP
Java and jsp
asp
Perl
Python
Ruby on Rails, etc.
This code has to do which:
Querying the database
Encode the data into html
Insert and update information onto the database
Business rules and calculations
The person in charge of server side programing must know:
some of the languages mentioned above
HTML
SQL,
linux/unix shell scripting
OOP
business rules, etc."
If the code is compiled/run on the clients machine, it is considered client-side. Serverside means a script which is compiled/run on the server before sending it to a browser. jQuery is just a library for JavaScript. That's all clientside.
For instance, some common used languages on the web.
Client-side: JavaScript
Server-side: PHP, Ruby, Perl
In Client side scripting,Script file usually download on client system and client browser compiled this script file and generate HTML. And Generated HTML display by browser.
EX- JavaScript file, Jquery file, AngularJs file.
In server side scripting, when user request page for display then script run on server and generate dynamic HTMl file and send this HTML file to user.
EX- Asp(.asp), Asp.Net(.aspx), PHP(*.php).
Please go through the below link
for client side programming and server side programming
https://softwareengineering.stackexchange.com/questions/171203/what-are-the-difference-between-server-side-and-client-side-programming
As for client side scripting and server side scripting. I think if you go through all the answers for this question you will get a clear idea.
jQuery is a framework that uses JavaScript internally.
Javascript isn't just a client-side scripting language. It is extensively used for it. But it ain't its only use. Its just the way we use Javascript to implement our functionality. Its a misconception that Javascript is used only for client-side scripting.

What is the way to use sqlserver with javascript on asp.net?

I'm working on a school project for that I've to make a forum. So I want to make it light using javascript which is run on client side. So regarding this I want to know how can I use sqlserver with javascript on asp.net. I'm new commerce and don't know much about this. I know how to handle it with c# but as every one knows it makes heavy due to run on server side.
You'll need some kind of server-side piece. You can't use JavaScript on the client to talk directly to an SQL Server instance. Even if you could hook it up in terms of the protocol and port and such, A) You'd have problems with security policies, and B) It would be a Really, Really Bad Idea to allow clients direct access to the DB.
So the typical architecture is: Client -> mid-tier -> database
These days it's not atypical for the mid-tier to be some kind of web service exposing a REST, XML, or JSON API.
You have lots and lots of choices for the mid-tier. Certainly C# and ASP.Net is one choice, but only one. There's Ruby on Rails, there's any number of JVM-based frameworks (Java EE, Play!, ...), there's PHP, there's Node.js...
I suppose one choice for the mid-tier is SQL Server itself. SQL Server 2005 offers a built-in set of web services you can enable via SOAP/HTTP. You would probably still run into issues with the Same Origin Policy, since I assume you won't be serving your web pages from the SQL Server. :-) Or maybe you could get around that, by configuring IIS to proxy for the SQL Server's SOAP/HTTP stuff and also to serve your pages, so they'd all be on the same origin (the host and port of the IIS server).

Categories

Resources