Date   

Re: Call REST webservice in XPA 3.3

Andreas Sedlmeier
 

Well fetching a JSON file/object via a http request is not yet exactly building a API with Magic on server side ... I would say. Continue your sample and write the server with Magic. Thats still easy but becomes close to impossible if you start with security, URL patterns and HTTP verbs, monitoring, ingress scaling, .... . A good API gateway gives you all that for free - without a single line of programming. Actually I had to install Kong yesterday as an alternative to Ambassador for a node.js based backend on a machine (VM) on client side and that was a matter of an hour (including PostgreSQL for persistency). Whats wrong with that ? ^^

Andreas


Re: Call REST webservice in XPA 3.3

 

What is wrong with updating a Blob with the results of this function: HTTPGet(Trim(A))      where A contains the URL of the REST webservice ?

The only implementation needed to be done is checking if the result is valid, and processing this result.

I did a quick test with this webservice 'https://jsonplaceholder.typicode.com/todos/1/comments', and I received a nice looking JSON-answer.

(For more info on this service see: https://github.com/typicode/jsonplaceholder )


Re: Call REST webservice in XPA 3.3

Andreas Sedlmeier
 

Hi Gabor,

When I wrote REST I actually mean all Web API programming different to SOAP, since you can have XML as data exchange format with REST of course too. That does not make it SOAP then however.

One way to get Web Apis (RESTful) work with Magic is by using a API Gateway resp. a reverse proxy. You would the simply build your API as you are used too (like with Swagger or so) and the URL patterns required to map this into Magic like ?app=xxx&prg=yyyy you solve by rewriting the URLs.

Its easy when you have a "internal" webserver (IIS / Apache) connected to your Magic application server. Outside world (API clients) you serve with the API gateway resp. reverse proxy. Look into things like Kong f.i. Then it might become clear what to do.

You can also get similar functionality with MS IIS and URL rewriting. Just not that good ;)

I still have a Magic Web Api example on my todo list which is based on Docker and Kubernetes. Unfortunately getting that work with Xpa Single user on Windows is too ambitious and a sponsor for a Linux license I did not yet find ^^. 

Best regards,

Andreas


Call REST webservice in XPA 3.3

Gábor Bor
 

Hy Magicians,

One of our client provide us a REST webservice. I tryed to access and get back the response XML, but i can't raise the solution. In the past at August 2018 Andreas said that in an other topic:

"SOAP is basically the only thing supported by Magic (with Apache Axis since 3.3), REST you have to implement by feet - with basically no support by the platform/framework (Magic)."


The access is successfull by the SOAPui and get back the result XML.

Do you have any solution? We are thinking on a .NET code (Invoke), but i would like to solve this task without it.

Best regards,

Gábor


Re: httpget on magic ver 9.4 (Solved)

Andreas Sedlmeier
 

I think Xpa has half of that bug / feature still too. There you would not need that update to a alpha, you could directly put the blob on the form - however (as far as I remember) only if its a Blob Unicode or Blob Ansi resp. text. Blob Binary would not work (resp. behave like 9.4). Thats however a pity and contradiction of the protocols because you cannot know what it is what you get from the http request before you actually did execute it. The server will tell what the content-type (and encoding) is and typically it's UTF-8 - which cannot be converted to ANSI (if response has character codes >= 128).

So actually it would be best if you directly write that blob to disk as a file with extension .html (if it is) and open it either with external browser or embedded broeser. Looks much better anyways :)

Best regards,

Andres


Re: httpget on magic ver 9.4 (Solved)

Frederik Soete
 

Hi,

Glad that worked out for you. At the early time of day that I replied, I did not recall assigning the blob value to the alpha being that straight-forward. The pesky bufget/bufset functions were floating in my mind when I told you it was hard to do.

Op do 20 dec. 2018 07:10 schreef Anton Doank <anton.khansa@...:

dear Frederik Soete,
i have solve my problem, i just only need to update my alpha with the blob :)..

thanks for your help

regards,
anton


Re: httpget on magic ver 9.4 (Solved)

Anton Doank
 

dear Frederik Soete,
i have solve my problem, i just only need to update my alpha with the blob :)..

thanks for your help

regards,
anton


Re: httpget on magic ver 9.4

Anton Doank
 

dear Frederik Soete,
thanks for your help, i have try save to file using blb2file it success so that i know the function httpget is running. actually i wanna get information from xml that i get from google maps api. 
my next question is :
i have success get get the xml to blob using httpget, than next step is i want to extract the data from xml that i have save in blob before into my new var b (blob)  using XMLBlobGet (0,1,'/GeocodeResponse/result[1]/address_component[1]/long_name') and its work and saved to var b,
my question is how we can convert blob to alpha? the data is only address that i get from google maps api maybe the length only 500 char. could u give more tips?

regards,
anton


Re: httpget on magic ver 9.4

Frederik Soete
 

Hi,

I do not think you can display your blob virtual's contents just by painting a control for that same virtual on the v9.4 screen (except for rich text format blobs). So, if you do not see any content, that would not necessarily mean the httpget failed. After the httpget, try to store the blob in a file using the function Blb2File(...), and inspect the resulting file. Also, if the httpget fails, there is also a related httperror function. This way you would know if your fetching the url worked or not.

As for displaying the blob contents: you could save the blob and display using an external editor. Otherwise you need to convert the blob to an alpha (not really all that simple, and alphas have limited length). Or you could embed some OLE control for displaying the html result as an interpreted web page, but then again you could simply embed internet explorer and navigate to the url, without using that blob. Just know that OLE and internet explorer may not stay around forever.

HTH,

Frederik Soete


Op do 20 dec. 2018 05:09 schreef Anton Doank <anton.khansa@...:

dear groups,
i am trying to load html result to blob.
i have make simple program like this
1. i have 1 virtual A as blob,
2. then i have form screen virtual A and button to trigger
3. when button pressed i just update virtual A with  HTTPGet('www.google.com')

my problem is :
1. the virtual A not show the result. is there any step that i missed it?
2. how to show blob var as the result httpget in the gui screen, is there any control properties that i should set?

any tips really appreciate
Regards,
anton


Re: What email clients do people use to send from magic?

Anton Doank
 

i use standard magic mailsend to send magic using gmail and set MailConnect (1,'smtp-relay.gmail.com','','') its work for me

anton


httpget on magic ver 9.4

Anton Doank
 

dear groups,
i am trying to load html result to blob.
i have make simple program like this
1. i have 1 virtual A as blob,
2. then i have form screen virtual A and button to trigger
3. when button pressed i just update virtual A with  HTTPGet('www.google.com')

my problem is :
1. the virtual A not show the result. is there any step that i missed it?
2. how to show blob var as the result httpget in the gui screen, is there any control properties that i should set?

any tips really appreciate
Regards,
anton


Invoking OS PDF in iOS Tablet or mobile phone

iluvmagic@...
 

Is this now possible to do? How do you guys do yours?

Please advice.

Thank you.


Re: Magic XPA 3.3b and MSSQL Very Slow

DarKWateR
 

Sorry I'm late.
F8 is ok (It's the real task. It's been running for over 10 years)

Don't worry, for now, the customer is still using 3.3A and will not update.

If some day the client is interested, I will take up the task to see what I see.
Thank you so much for your help.


Re: Providing Web Services with magic xpa3.3 and axis2

אבי אבקסיס
 

Tank you Luuk

If you extract magicxpa3.3a.exe, from cmd
"Magicxpa3.3a.exe" /Extract_all:"C:\Magic xpa3\unzip_directory"
the systinet is missing
magic documents recomend to install systinet manualy to overcome configuration conflicts
on some machines, and this starts with Extracts_all...
Best regards 
Avi 

‫בתאריך יום ג׳, 18 בדצמ׳ 2018 ב-20:37 מאת ‪Luuk‬‏ <‪luuk34@...‬‏>:‬

The helpfile of Magic XPA3.3a, is still linking to systinet:
file:///C:/Program%20Files%20(x86)/MSE/Magic%20xpa%203.3a/Help/index.htm#t=mergedProjects%2FMastering_eDeveloper%2FHow_Do_I_Provide_Web_Services_with_Magic_xpa.htm&rhsearch=web%20services&rhsyns=%20&rhhlterm=web%20services
…..

Verifying Systinet
When Systinet is installed, you will have some entries on your Start menu that will allow you to start and stop the server, and to use the Systinet console

….


But probably the helpdoc with these contents are the closest to this subject:
file:///C:/Program%20Files%20(x86)/MSE/Magic%20xpa%203.3a/Help/index.htm#t=mergedProjects%2FTechnical%20Notes%2FDeploying_Web_Requesters_on_Different_Servers.htm&rhsearch=tomcat&rhsyns=%20&rhhlterm=tomcat 


Re: Providing Web Services with magic xpa3.3 and axis2

Andreas Sedlmeier
 

Hi Luuk,

That link goes to your local disk, all those help pages are online too: http://kb.magicsoftware.com/articles/bl_Reference/Deploying-Web-Requesters-on-Different-Servers-xpa-3x . Thats however only about web requesters and b) a "not good for much" style document. In Xpi dopcumentation MSE typically invests a bit more and there's some more documentation. Starts here: http://kb.magicsoftware.com/articles/bl_Reference/Web-Services-Utility-xpi-45 

Actually I think, Xpa is around 15 years behind current webservices/microservice technology and you need Xpi (and Gigaspaces) anyway, if you plan to do something serious  ... with Magic technology for providing and consuming webservices. Probably you have your service (REST) done before you were able to explain your business partner what SOAP actually is. I just did not see later Xpi versions yet and cannot tell if it improved a lot in that respect. Was a pain too, webservixes with Xpi a few years ago.

Best regards,

Andreas


Re: Providing Web Services with magic xpa3.3 and axis2

אבי אבקסיס
 

Tank you Andreas

Till xpa 3.2 magic installs the systinet,  xpa3.X comes with well documented for systinet
in MasteringMagic xpa.pdf page 885,  but the instalation  includes tomcat and  axis2  and not systinet at all.

Best regards 
Avi 

‫בתאריך יום ג׳, 18 בדצמ׳ 2018 ב-18:13 מאת ‪Andreas Sedlmeier‬‏ <‪sedlmeier@...‬‏>:‬

Hi Avi,

As Gábor already mentioned, it's there (Axis2) and it even ships with Single User Edition of 3.3, only that you cannot use it with SU.

You can create a Axis2 component in CRR and press F1 and then you can dive into all the documentation (which is I think half a page for Axis2 alltogether).

Webservices with XPA and status of Systinet is a bit unclear, cause XPI 4.7 I think still would install Systinet (or Tomcat) and XPC is node.js anyways. Tomcat you could also get working with XPA, there's a requester, ... . Besides there's also another undocumented feature re webservices in Xpa: WCF (.NET) and some other stuff.

The idea behind not providing any documentation and/or samples is I think to keep the MSE consultants busy cause MSE is a PS organization anyways meanwhile (basically, imho). 

Best regards,

Andreas



Re: Providing Web Services with magic xpa3.3 and axis2

אבי אבקסיס
 

Tank you Gábor
I'll try it
Avi Avikasis

‫בתאריך יום ג׳, 18 בדצמ׳ 2018 ב-0:42 מאת ‪Gábor Bor‬‏ <‪bor.gabor@...‬‏>:‬

Hi Avi,

It's clearly supports it. The Tomcat Axis 2 environment is installed by my colleague but with configure the solution works fine. You could find too the MobileDevices webservice sample in the package. It gives sample, and with configure the java file which means the source of wsdl on axis 2 server, you could access it. 

I can use it by SOAPui and call from XPA with HTTPcall as well. I make the answer XMLs by XPA merge function and gives back on the Poperty sheet's Return value as Blob. (Try with types Unicode, Ansi, Byte)

You should try it. ;)

Best regards,
Gábor


Re: Providing Web Services with magic xpa3.3 and axis2

 

The helpfile of Magic XPA3.3a, is still linking to systinet:
file:///C:/Program%20Files%20(x86)/MSE/Magic%20xpa%203.3a/Help/index.htm#t=mergedProjects%2FMastering_eDeveloper%2FHow_Do_I_Provide_Web_Services_with_Magic_xpa.htm&rhsearch=web%20services&rhsyns=%20&rhhlterm=web%20services
…..

Verifying Systinet
When Systinet is installed, you will have some entries on your Start menu that will allow you to start and stop the server, and to use the Systinet console

….


But probably the helpdoc with these contents are the closest to this subject:
file:///C:/Program%20Files%20(x86)/MSE/Magic%20xpa%203.3a/Help/index.htm#t=mergedProjects%2FTechnical%20Notes%2FDeploying_Web_Requesters_on_Different_Servers.htm&rhsearch=tomcat&rhsyns=%20&rhhlterm=tomcat 


Re: Providing Web Services with magic xpa3.3 and axis2

Andreas Sedlmeier
 

Hi Avi,

As Gábor already mentioned, it's there (Axis2) and it even ships with Single User Edition of 3.3, only that you cannot use it with SU.

You can create a Axis2 component in CRR and press F1 and then you can dive into all the documentation (which is I think half a page for Axis2 alltogether).

Webservices with XPA and status of Systinet is a bit unclear, cause XPI 4.7 I think still would install Systinet (or Tomcat) and XPC is node.js anyways. Tomcat you could also get working with XPA, there's a requester, ... . Besides there's also another undocumented feature re webservices in Xpa: WCF (.NET) and some other stuff.

The idea behind not providing any documentation and/or samples is I think to keep the MSE consultants busy cause MSE is a PS organization anyways meanwhile (basically, imho). 

Best regards,

Andreas



Re: Providing Web Services with magic xpa3.3 and axis2

Gábor Bor
 

Hi Avi,

It's clearly supports it. The Tomcat Axis 2 environment is installed by my colleague but with configure the solution works fine. You could find too the MobileDevices webservice sample in the package. It gives sample, and with configure the java file which means the source of wsdl on axis 2 server, you could access it. 

I can use it by SOAPui and call from XPA with HTTPcall as well. I make the answer XMLs by XPA merge function and gives back on the Poperty sheet's Return value as Blob. (Try with types Unicode, Ansi, Byte)

You should try it. ;)

Best regards,
Gábor

6541 - 6560 of 195858