Date   

Re: Get all data from WebService in Magic XPA 3.2c

Andreas Sedlmeier
 

Hi Neil,

I created you a Magic XPA 3.3 sample, which is available (complete project + export file) here: https://github.com/asedl/XpaDemo/tree/master/Components/Samples/WsDemo . I have only Magic Xpa Single User which is Xpa 3.3. If you cannot import the project in a Xpa application of yours you'll have to downlaod Xpa Single User edition from MSE.

In the sample there's two programs:
GetAuthors which fetches a list of Authors from a .NET webservice method "ListAuthors"
Read_XML_Response which parses the XML response of the ws into a temp. table (sqlite)

For me this works fine, the code of the .NET ws method I paste below.

Good luck and best regards,

Andreas

==

namespace XpaDemoSrv
{
    /// <summary>
    /// Summary description for Books
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class Books : System.Web.Services.WebService
    {
 
        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }
 
        [WebMethod]
        public DataTable ListAuthors() {
 
            // Create a DataTable with a name and add a few records ...
            DataTable dtAuthors = new DataTable(); 
            dtAuthors.Columns.Add("author_id");
            dtAuthors.Columns.Add("author_name");
            dtAuthors.TableName = "dtAuthors";
 
            DataRow newAuthor;
            newAuthor = dtAuthors.NewRow();
            newAuthor["author_id"] = "1";
            newAuthor["author_name"] = "James Joyce";
            dtAuthors.Rows.Add(newAuthor);
            newAuthor = dtAuthors.NewRow();
            newAuthor["author_id"] = "2";
            newAuthor["author_name"] = "Franz Kafka";
            dtAuthors.Rows.Add(newAuthor);
            newAuthor = dtAuthors.NewRow();
            newAuthor["author_id"] = "3";
            newAuthor["author_name"] = "Ernest Hemingway";
            dtAuthors.Rows.Add(newAuthor);
            newAuthor = dtAuthors.NewRow();
            newAuthor["author_id"] = "4";
            newAuthor["author_name"] = "Thomas Mann";
            dtAuthors.Rows.Add(newAuthor);
 
            return dtAuthors;
        }
    }
}


Sending BLOB parameter from XPA to HTTP trigger in Magic XPI 4.7

Kumbhar, Sunil
 

Hello All,
In our project we are calling HTTP trigger from XPA to XPI. As trigger has multiples parameter, we wanted to send it through BLOB. but we are getting below error when we use blob as parameter, does anybody have idea of this  error. In same flow we have another trigger having alpha parameters and it is working.

HTTP Error 500.0 - Http2IFR.processHttpReq - HttpRequest: exchangeId=[4376e26c-dcce-43b9-b84e-17ea4acf46be] . CONVERT_FAILED. Converting HTTPRequest to FlowRequest failed. General error..java.lang.NullPointerException

The page cannot be displayed because an internal server error has occurred.


Re: Parameters with DSQL-tasks [XPA3.2]

Mr Magic
 

That's right , strange behavior ... 
but both solutions works fine : 
1. moving DSQL to subtask 
2.using local variables for output 

anybody know the limit of charaters in DSQL statement (in magic task) ? 

Ariel Kotler - Magic Line
www.magicline.co.il


On Thursday, December 6, 2018, 7:59:19 PM GMT+2, Avgerinos <mento@...> wrote:


Hi Florian

DirectSQL input parameters work ok for me (at least in in XPA3.1x)
But regarding DirectSQL output-parameters, I found they will not work if
they are also declared as task parameters.
So I use local variables instead and update the task-parameters on task
suffix

Regards
Avgerinos

On 5/12/2018 4:05 μμ, Florian Groothuis wrote:
> Hi all,
>
> I have a batch task with 3 parameters and the main source is a
> DirectSQL command. One of the parameters is the input parameter for
> the DSQL, the other two are the output parameters of the DSQL
> Surprisingly, when I call the task, the parameters are not filled with
> the values I pass. If I move the DSQL-task to a subtask, the task
> works fine.
> Is there different behaviour of parameters on a DSQL-task I don't know of?
>
> TIA
> Florian




Re: Get all data from WebService in Magic XPA 3.2c

 
Edited

Hi Andreas,

I kinda get the procedure you said in the: "There you can put your service endpoint followed by "?wsdl" and Magic will download the WSDL and list you the available operations (methods) . You should have a method named "getAlltbEmpList" there."

but not much on the next procedure.

Thank you for this! And yes, kindly send me a small sample regarding to this situation to my email:
Email: ndeleon @ everywhereconsulting.com

Thank you & have a great day,

Neil


Re: Parameters with DSQL-tasks [XPA3.2]

Avgerinos
 

Hi Florian

DirectSQL input parameters work ok for me (at least in in XPA3.1x)
But regarding DirectSQL output-parameters, I found they will not work if they are also declared as task parameters.
So I use local variables instead and update the task-parameters on task suffix

Regards
Avgerinos

On 5/12/2018 4:05 μμ, Florian Groothuis wrote:
Hi all,

I have a batch task with 3 parameters and the main source is a DirectSQL command. One of the parameters is the input parameter for the DSQL, the other two are the output parameters of the DSQL Surprisingly, when I call the task, the parameters are not filled with the values I pass. If I move the DSQL-task to a subtask, the task works fine.
Is there different behaviour of parameters on a DSQL-task I don't know of?

TIA
Florian


Re: Get all data from WebService in Magic XPA 3.2c

Andreas Sedlmeier
 

Hi Neil,

I have no Walk through, its however not that difficult.

Create a batch program or event handler and insert a "Invoke Web S Lite" operation. Double click it or zoom into it to get the WSDL selection.

There you can put your service endpoint followed by "?wsdl" and Magic will download the WSDL and list you the available operations (methods) . You should have a method named "getAlltbEmpList" there.

That you select and it will be of type (style) "Document". The method returns a XML document which you assign to a Blob (Unicode). That (XML Blob) you do read with XML direct access functions in another task where you have the XML Blob as a I/O entry of type Variable.

Write the result in a table (sqlite or memory) and you basically have what you want. You might also be able to use functionality of your DBMs to convert the XML to a (temporary table). 

If you cannot get that working I can provide you with a small sample, not before the weekend however.

Best regards,

Andreas



XPA 3.3b - Screen flickers when wallpaper set in Main program

mimi_4s2000@...
 

Hi all,

I have very strange problem with 3.3b. When i set wallpaper (low res, high res) in Main program and run the app background flickers when i'm moving forms, or just scrolling through menus.

This behavior wasn't present in 2.x. It's very annoying.

Here you can check video of that problem.
https://vimeo.com/304781898

TIA,
Alan


Re: Get all data from WebService in Magic XPA 3.2c

 
Edited

Hi Andreas,

after invoking the wsdl what should i do next?

can you walk me through this? like step by step procedure?

I want to output it in a table form...

Thank you and I highly appreciate your help! :)

***By the way, I use WSLite to invoke my WSDL***


Re: Profiler

Arch <Arch.Lineberger@...>
 

Thanks, guys. I had to go back to the help file in v9 to find any reference to the MGPROF. Found it and it works!

Arch Lineberger
203 N Main St
Belmont, NC 28012
704.461.1223


On Wed, Nov 14, 2018 at 3:50 AM Marc Gauthier <gaum02@...> wrote:
Arch,

We had a weird performance issue in XPA that we resolved in a special way. 

A simple Batch task reading many records with ranges

It was calling programs in the record suffix reading the same table as the calling batch task (not ideal but was working in 2.5 and not time to rewrite complex pro programs).

We create a group change in the batch task and move the record suffix operations to the group change. Made a huge difference in performance.

This was with XPA 3.2e with a pervasive Database.

I used the profiler and Magic Optimizer profiler analysis to figure out where was the bottleneck.



Hope it helps

Marc






Re: Does anyone have a solution that works on how to consume a web service via SSL with magic xpa 3.2c.

Andreas Sedlmeier
 

On Tue, Dec 4, 2018 at 07:39 PM, <jrlavie3000@...> wrote:
Does anyone have a solution that works on how to consume a web service via SSL with magic xpa 3.2c.
Does this mean that you know how to consume a webservice with Xpa 3.2c without SSL (TLS) and now are wondering how to get it work with SSL, or does it mean that you just start from scratch and never did consume any webservice with Magic Xpa ?

If you have an existing client/consumer you use https instead of http for your service endpoint and basically that's it.

There's of course this TLS 1.2 (SSL, early TLS) issues so SSL wont work at all most of the time but only TLS 1.2 does and for that you need at least Magic Xpa 3.3b (and Xpa 4.x if you also work with client certificates).

You can consume the webservice with a 3'rd party app or library instead if you have TLS 1.2 trouble and no chance to go to Xpa 4. I have some samples in a demo project: https://github.com/asedl/XpaDemo/blob/master/Doc/XpaHttp.md

Best regards,

Andreas


Parameters with DSQL-tasks [XPA3.2]

Florian Groothuis
 

Hi all,

I have a batch task with 3 parameters and the main source is a DirectSQL command. One of the parameters is the input parameter for the DSQL, the other two are the output parameters of the DSQL  Surprisingly, when I call the task, the parameters are not filled with the values I pass. If I move the DSQL-task to a subtask, the task works fine.
Is there different behaviour of parameters on a DSQL-task I don't know of?

TIA
Florian


Re: Get all data from WebService in Magic XPA 3.2c

Andreas Sedlmeier
 

Hi Neil,

Add "?wsdl" (without quotes) to the URL of your service endpoint. That should return you the WSDL and that URL you can use for the Invoke Webservice Operation in Xpa.

Alternatively you can do the requests "by foot" with Magic HttpCall (or an alernative http client). Since you do however work with C# for the producer anyways, you could also simply put the client in a .NET class library (better) or Magic Xpa .NET Snipplet (worse). That saves you from a lot of headache later on when you start to secure your webservice, work with API tokens, ...

Best regards,

Andreas


Get all data from WebService in Magic XPA 3.2c

 

Hi, 

I have created my own WebService using c# with the following code: 
---------------------------------------------------------------------------------------------------------------- 
[WebMethod] 
public DataTable getAlltbEmpList() 

string constr = ConfigurationManager.ConnectionStrings["CustomerEntities"].ConnectionString; 
using (SqlConnection con = new SqlConnection(constr)) 

using (SqlCommand cmd = new SqlCommand("SELECT * FROM tbEmployee")) 

using (SqlDataAdapter sda = new SqlDataAdapter()) 

cmd.Connection = con; 
sda.SelectCommand = cmd; 
using (DataTable dt = new DataTable()) 

dt.TableName = "tbEmployee"; 
sda.Fill(dt); 
return dt; 





---------------------------------------------------------------------------------------------------------------- 

My concern is, how can I consume it on my created application in Magic XPA 3.2c? 

I'd like to output it in table form... 

(If this question is insufficient, just let me know) 

**Note: the webservice that has been created is completely working and no error.** 

Thank you in advance!


Does anyone have a solution that works on how to consume a web service via SSL with magic xpa 3.2c.

jrlavie3000@...
 

hi,
Does anyone have a solution that works on how to consume a web service via SSL with magic xpa 3.2c.

Best regards


Re: Magic XPA 3.3b and MSSQL Very Slow

Andreas Sedlmeier
 

Well but ALLOW_SNAPSHOT_ISOLATION ON is what you can expect improved performance from because (in theory) it would allow the DBMS (MSSQL) to have everything in memory too and thats the reson why a single, explicit, physical transaction improves performance for you so much. READ_COMMITTED without that ALLOW_SNAPSHOT_ISOLATION=ON should actually perform worse than READ_UNCOMMITTED (what you have). Besides it would block your client if you try to read a record where somebody holds a lock (which is the reason why in Magic world everybody works with DIRTY_READ, something where Oracle says it should not even exist).

Im wondering if your program, where you say it has no transaction and performs well if you add one, actually passes the checker (F8) ?

Andreas


Re: Magic XPA 3.3b and MSSQL Very Slow

DarKWateR
 
Edited

I tried the options you indicated, except ALLOW_SNAPSHOT_ISOLATION ON, because I do not have access to the database of the client.
In principle, it's still slow.
It only occurs to me that each pair SET IMPLICIT_TRANSACTIONS ON and OFF, for each FETCH to the database, is the problem of slowness with this version of OLE DB.
I will continue testing and I will comment if I get something.
Thank you very much and I sorry for my English.


Re: Magic XPA 3.3b and MSSQL Very Slow

DarKWateR
 
Edited

I'm sorry, I misinterpreted your comment.

In Xpa, DBMS MSSQL uses Read uncommitted (0).

I'll try what you said.
Thank you so much!


Re: Magic XPA 3.3b and MSSQL Very Slow

Andreas Sedlmeier
 

Yes, I know what you mean. A batch with transaction=no will result in a single select for each record, covered by a single transaction. If this requires locks depends on your isolation level. If its RR, it will lock the complete table for writing by others. The question which isolation level you actually work with, you did not answer.

Either you change all your batch programs or you try what I wrote, work with isolation mode READ COMMITTED and set ALLOW_SNAPSHOT_ISOLATION ON (in your MSSQL database).

Also try with 
READ UNCOMMITTED (dirty read) to see if there's a (big) difference in performance. 

Best regards,

Andreas


Re: Magic XPA 3.3b and MSSQL Very Slow

DarKWateR
 

Sorry!
When i said "without transaction", i only meant "No Transaction at XPA Task" (implicit in database)

The difference between xpa 3.3a in my case is (always talking from xpa, not database):
Xpa 3.3a Works ok with and without transaction in batch task.
Xpa 3.3b only works ok with transaction active in batch task. With transaction to No, is very very very very slow.


Re: Magic XPA 3.3b and MSSQL Very Slow

Andreas Sedlmeier
 

Hi Darkwater,

Its not possible to work without transactions in MSSQL (actually not possible with any DBMS besides maybe Informix). If you do not work with explicit transactions, it will be implicit transactions - every single statement is wrapped in a transaction (autocommit).

What is the isolation mode you work with. I can imagine that you worked with 0 (dirty read) in the past and now default is 1 (committed read). Dirty read you better avoid, you can however work with snapshot isolation in MSSQL and that should bring back some performance. Try with READ COMMITED and enable snapshot isolation: https://docs.microsoft.com/en-ie/dotnet/framework/data/adonet/sql/snapshot-isolation-in-sql-server for the database

Thats not a real committed then, MSSQL behaves then like Oracle does by default since ever.

Best regards,

Andreas

6721 - 6740 of 195966