Submitted by Syd Nicholson on Fri, 12/01/2006 - 00:00
Forums

I am playing with IceBreak and want to give SOAP a try. I probably should know how to do this, but I am not sure how to hang all the bits together.

I am creating a simple scenario:

1. A service program on the iSeries created as a .asp or .rpgle. I want this service program to output the date and time in a SOAP envelope
2. A browser page, using AJAX, contacts this web service and places the date and time on the web page.

Complications arise when I try to pass parameters. - for example the required date format (eg. DMY, MDY, YMD, ISO, etc.)

Any help would be greatly appreciated.

Thanks
Syd

Niels Liisberg

Thu, 12/07/2006 - 00:00

SOAP and AJAX is not compatible - just like that.

You can however - if you have the time create a webservice (like tutorial 21 ) and the build the SOAP envelope in the AJAX client, and the parse the response with the activeX MSXML6.0 component. The you have the webservice response in javaScript object format

Thanks Niels,

If I understand this correctly - JavaScript in the browser cannot talk (via Ajax) to a service program. I must always create a program object that is then called from the browser. That program object, can talk to a web service on another system, or can be be webservice itself?

Regards
Syd

Yes - you got it right.

WebService describes "methods" with in a service request, which maps fine to service programs with procedures....

AJAX however is only Posting / getting a resource with parameters which maps to ASP programs

Niels

Hi Syd,


"You can however - if you have the time create a webservice (like tutorial 21 ) and the build the SOAP envelope in the AJAX client, and the parse the response with the activeX MSXML6.0 component. The you have the webservice response in javaScript object format"

I'm sorry Niels, but I have to advice differently on this ActiveX idea... you should NEVER use proprietary code in web-applications. All web applications should run cross-browser, cross-platform! It's as simply as that!

One thing you should take a look at, Syd, is the E4X which will be included in the next official version of JavaScript and thus implemented in all browsers... IE might have it in say.... 5-10 years from now  But Firefox, Mozilla, Opera have it already!

Also take a look at an article IBM wrote last year: Call SOAP Web services with Ajax, Part 1: Build the Web services client

Best regards,

John Foldager
www.izone.dk

"John - I don't know much about SOAP ( I thought it was a Microsoft thing), but you can write AJAX applications with RPG using IBM API's or with low cost/free tools like Cozzi's xTools or IBM's free CGIDEV2."

Yes I know, but since this is an IceBreak forum and IceBreak is an application server in which you create programs in either RPG or Cobol CGIDEV etc. is not relevant. Well... everything is relevant, but I think that CGIDEV examples etc. should reside on one of the other forums 

I don't know which IBM API's you are refering to, but if you take a look at "Ajax" it actually stands for "Asynchronous JavaScript and XML"... and as such not many application servers can actually run JavaScript serverside. I have a Java application framework that can actually run JavaScript both clientside and serverside (using Java Servlets), but if you look at most application servers they do not support this. What you can do is to create the HTML and/or JavaScript source code on the serverside and send it to the clientside (the browser) and have it run there, so you can actually "write Ajax applications" with any application server on the market as long as they can provide a webbrowser with the content and set the corrent Content-type 

Hope this clarifies the Ajax principle.

Best regards,

John Foldager
www.izone.dk

Hi itp, John, Syd;

As you know the IceBreak has a build in AJAX implementation for client side access to IceBreak ASP programs. You don't need to look further for that.

See the tutorial 22.

John - You wrote: "not many servers have JavaScript support" - which is true. The IceBreak team is, however working on porting "SpiderMonkey" to IceBreak, which hopefully will make you happy 

look at : www.mozilla.org/js/spidermonkey/

Regarding using Microsoft components on not: I think it is a question if you like it with chocolate or vanilla and is depending on the specific solution you are writing. ..... But standards is good - don't get me wrong.

By the way - the AJAX "native httprequest" implementation in IE7 really sucks  !! Now Microsoft has implemented the native way to create the standart object -  - but it don't support the same methods as Fox, Moz, Saf, Opr etc. - resulting in Ajax implementations out there will fail. 

We have fixed this with some extra if's and try's in the adAjaxCall in build0100 of IceBreak ... but what a waste of time 

Niels

 Originally Posted by Niels Liisberg: 
"As you know the IceBreak has a build in AJAX implementation for client side access to IceBreak ASP programs. You don't need to look further for that.

See the tutorial 22."

I know... but have not used your implementation 


 Originally Posted by Niels Liisberg: 
"John - You wrote: "not many servers have JavaScript support" - which is true. The IceBreak team is, however working on porting "SpiderMonkey" to IceBreak, which hopefully will make you happy 

look at : www.mozilla.org/js/spidermonkey/"

That depends... of how you implement it. Hopefully you won't create a bunch of IceBreak related functions directly in the main scope, but instead put everything inside an "IceBreak" or similar this-will-never-be-a-standard-to-JavaScript-in-the-future. Furthermore, it depends on how easy it is from the JavaScript engine to call other programs, execute and return result sets from SQL, etc. etc.

When you are ready to launch a build with support for server-side VBScript, JavaScript, C++ etc. then remember to tell you marketing department that they should change marketing material whereever it says that everything runs native compiled code to something like "RPG and Cobol will result in native compiled code whereas VBScript, JavaScript and C++ programs will run inside a runtime environment in a native compiled program". You know what I mean 


 Originally Posted by Niels Liisberg: 
"Regarding using Microsoft components on not: I think it is a question if you like it with chocolate or vanilla and is depending on the specific solution you are writing. ..... But standards is good - don't get me wrong."

If you just do it the "standards" ways then you won't have to think so much and it will just work... so why use a proprietary method when the standard way is just as easy... and makes applications that can run 5 years from now without modifications? 


 Originally Posted by Niels Liisberg: 
"By the way - the AJAX "native httprequest" implementation in IE7 really sucks  !! Now Microsoft has implemented the native way to create the standart object -  - but it don't support the same methods as Fox, Moz, Saf, Opr etc. - resulting in Ajax implementations out there will fail. 

We have fixed this with some extra if's and try's in the adAjaxCall in build0100 of IceBreak ... but what a waste of time"

I haven't tried the IE7 implementation of it yet, but could you please provide an example that will fail in IE7? I'd really like to see what it is that you are talking about.

Best regards,

John Foldager
www.izone.dk

Hi John;

The new IE7 instantiates ajax like Moz NetS and Saf by:

 
    // Mozilla | Netscape | Safari | IE7
      objXmlHttp = new XMLHttpRequest(); 

And IE6 does it with 

 
  xmlHttp = new ActiveXObject(clsid); 

where clsid is: 

 
   var clsids = ["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0",
                 "Msxml2.XMLHTTP.4.0","Msxml2.XMLHTTP.3.0",
                "Msxml2.XMLHTTP.2.6","Microsoft.XMLHTTP.1.0",
                 "Microsoft.XMLHTTP.1","Microsoft.XMLHTTP"]; 

The problem is that the methods is still the old activeX and not the standart, so you have to "try" which methods is available .... bugger !!!: 

 
     try {
       objXmlHttp.onload = ...
       objXmlHttp.onerror =  ..
     }
     catch(e) {}

     try {
        objXmlHttp.onreadystatechange = ...
     }
     catch(e) {} 

 Originally Posted by Niels Liisberg: 
"My DOJO does not work under IE7 .... it has the same problem as IceBreak before build0100 !!"

Actually it doesn't surprise me (I must admit that I haven't looked at the Dojo implementation of this).Too many of the Ajax implementations out there tries to instantiate the Microsoft ActiveX first because they think that most users run Internet Explorer. What they should always do is to try to instantiate the standard way of doing things first (try {.... } catch(e) {}) and if an exception is caught it should try for the non-standard ways. Wouldn't you agree that this is the ultimately best approach?  Go for the standards... and if the user agent doesn't support it you can try to hack around the non-standard implementations if you want to.


Best regards,

John Foldager
www.izone.dk

Hi John

Absolutely - and that's how it is done in the IceBreak AJAX.

However we did not expect Microsoft to implement the "standard way" with proprietaire methods .... but of cause 


Niels

You guys just don't seem to get it.

Code400 is forum dedicated to mutual support, sharing of ideas, open source code and programming techniques.

You folks have been going on and on about one commercial product that you all seem to develop or sell.

Most of your "questions" seem to come from your own development team.

You do seem to have have not asked, commented or answered a single question not related to your product.

Maybe take a look around your "official" forum and see how other people behave here.

itp

Hi itp... don't get me wrong, but...


 Originally Posted by itp: 
"You guys just don't seem to get it.

Code400 is forum dedicated to mutual support, sharing of ideas, open source code and programming techniques.

You folks have been going on and on about one commercial product that you all seem to develop or sell."

First of all... I'm just commenting on posts that I think I know something about. Hopefully helping other people in understanding the product and technologies. It is correct that IceBreak is a commercial product... just as J.D.Edwards etc. (also found on this site). I wasn't aware that the only things you could talk about was open source solutions. Especially since you have created the "IceBreak" section with three sub-forums. I was under the impression that questions related to this product should be put in these forums instead of using the "normal" forums like "RPG", "DDS", etc.

Secondly... I have never been involved in the development of the IceBreak product. I have, however, suggested a lot of was has since been implemented into the core product. I'm proud of this and will continue to answer any questions related to this, and even give suggestions of what can be achived with it if I want to. I believe that IceBreak is a really great product and will happily support it (the development team knows this too... even though they are not always listening to my suggestions and oppinions  ). As I stated in a previous thread I'm doing both IceBreak and Websphere applications, and for that matter PHP and Lotus Notes/Domino etc.


 Originally Posted by itp: 
"Most of your "questions" seem to come from your own development team."

I haven't seen a single question (except for the question for new functionaly/features) comming from the IceBreak development team. I have, however, seen a lot of answers from them... answers to questions given by people using IceBreak as an application server. If they give an answer to someone elses questions which I feel is a good answer I will not comment further on it. If they happen to "jump" over a couple of questions or give an answer which is Microsoft-specific etc. and I feel that it should have been an answer supporting standards etc. then I will comment on it and give my oppinion on it. I might "step the development team over their feeds" by doing so, but I feel that questions should be give the best and most objective answer... even if it involves using another technology or product than IceBreak and what they choose to use in their answers.


 Originally Posted by itp: 
"You do seem to have have not asked, commented or answered a single question not related to your product."

That is mainly because I'm new to this forum and as such start by answering the questions that I know I have knowledge about (here in the IceBreak forums). I might answer questions on some of the other forums as well, but it takes time and I have do be with my family and earn money too... 


 Originally Posted by itp: 
"Maybe take a look around your "official" forum and see how other people behave here."

I don't know what you mean by "your 'official' forum". I have asked (in another thread) if this (code400.com) could be seen as the official forum for IceBreak and from the answer from the IceBreak development team I understand that it could not(!). I believe that IceBreak does not have an official forum.

If you refer to "IceBreakForum.org" then my company, iZone, owns this domain and it was our intention to use it for a website with online documentation and reference for the core IceBreak as well as HTML, XML and RPG code syntax, examples etc. It has been loooong underway and has been inactive a long time, mainly because of missing documentation from the IceBreak team regarding a lot of functionality. We (iZone) didn't want to launch a partial documentation so we have been waiting for the core IceBreak team to deliver core functionality examples. When we get this for all functions we will open up the site with code examples etc. But a dedicated forum will not be one of the first thing. Even though the forum will be mainly usefull for IceBreak developers I'm sure that some of the articles that we are working on regarding web programming, "Web 2.0", Ajax etc. should be usefull for people using CGIDEV, Websphere etc. as the basic functionality is mainly the same across all programming languages and application servers.

This was just my point of view - from outside the IceBreak Development Team, that is! 

Best regards,

John Foldager
www.izone.dk
www.icebreakforum.org

Itp,

I absolute agree when you say that “Code400 is forum dedicated to mutual support, sharing of ideas, open source code and programming techniques.” I feel that this is 100% what we are trying to do here! E.g. take a look in the current thread and see how to solve a problem with Ajax in different browsers or http://www.code400.com/forum/showthread.php?t=2732 with lot of code samples for Web services etc.

"You folks have been going on and on about one commercial product that you all seem to develop or sell"

-AND-

"Most of your "questions" seem to come from your own development team"

This is NOT correct. The product is developed by System & Method Technologies, Denmark (former Agent Data). I can assure you that there have only been 3 deferent visitors from us in code400 - that is Niels, Bjarke and I. All other visitors here come from other companies.

"You do seem to have have not asked, commented or answered a single question not related to your product"

We do not ask questions about IceBreak here - it is our product so it would make no sense. It is true that we answer questions coming into the IceBreak forum – concerning IceBreak or questions related IceBreak. Other questions will not be posted here – I think…

I hope we still can have a positive dialog here in code400.

Regards,

Bent Ronne,
System & Method Technologies, Denmark

http://www.agentdata.com