Wed Oct 28, 2020 9:12 pm
Login Register Lost Password? Contact Us


Use SOAPCALL to call Roxie function with interface params

Questions and comments regarding the Online Lessons should be posted here.

Tue Nov 12, 2013 9:06 am Change Time Zone

I am trying to get a hang of SOAPCALL usage.

I picked up the Roxie function we published in the online Roxie trainings - PersonsFileSearchService2. This takes StateParams and NameParams, both interfaces, as parameters apart from a gender parameter.

I used the following piece of code to call the Roxie service:
Code: Select all
filteredRecSet := SOAPCALL(RoxieIP,
                           svc,
                 SearchServiceParams,
                           DATASET(OutRec1));


where SearchServiceParams has been defined as

Code: Select all
SearchServiceParams := RECORD
   STRING25 LastName := 'SMITH';
   STRING15 FirstName := '';
   
   STRING2 State := 'NJ';
   STRING1 Sex := 'M';   
END;


The idea was to combine params from both interfaces into an input record structure and pass. But, apparently, that is wrong since it didn't work. How should I call it instead?

Also, the error message I am getting may not be because of the params. This is what I get:

Error: System error: -3: Graph[1], SOAP_rowdataset[2]: SLAVE 192.168.253.131:20100: <Error><text>connection&#32;failed&#32;192.168.11.131:8002</text><url>http://192.168.11.131:8002/WsEcl/soap/query/myroxie/personsfilesearchservice2</url></Error>,

Pls help.

Regards,
Gayathri
Gayathri_Jayaraman
 
Posts: 75
Joined: Wed May 08, 2013 5:03 am

Tue Nov 12, 2013 3:39 pm Change Time Zone

Hi Gayathri,

Error: System error: -3: Graph[1], SOAP_rowdataset[2]: SLAVE 192.168.253.131:20100: <Error><text>connection&#32;failed&#32;192.168.11.131:8002</text><url>http://192.168.11.131:8002/WsEcl/soap/query/myroxie/personsfilesearchservice2</url></Error>,


Yes, it may not be related to the interface question. What I would do is test your SOAPCALL with another published query that is NOT using an interface, and this will verify if the problem is in the RoxieIP and/or port.

Regards,

Bob
bforeman
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1002
Joined: Wed Jun 29, 2011 7:13 pm

Wed Nov 13, 2013 12:19 pm Change Time Zone

It failed with the same error :cry:
Gayathri_Jayaraman
 
Posts: 75
Joined: Wed May 08, 2013 5:03 am

Wed Nov 13, 2013 1:11 pm Change Time Zone

Gayathri,

This looks like you are trying to make a SOAPCALL to a local VM, correct? To be honest, I've never tried that before. Let me tinker with it here today.

My guess is that it may be either be blocked or possibly an incorrect port. What if you switch the port from 8002 to 9876?

Meanwhile, let me test here and I will get back to you.

Regards,

Bob
bforeman
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1002
Joined: Wed Jun 29, 2011 7:13 pm

Wed Nov 13, 2013 3:01 pm Change Time Zone

Hi Gayathri,

Yes, the secret to accessing your queries via SOAPCALL is to access the node directly using the 9876 default configuration port.

For example, here is the Data Tutorial ROXIE query that I am accessing via SOAPCALL:
Code: Select all
outRecord := RECORD
  STRING15 FirstName{xpath('firstname')};
  STRING25 LastName{xpath('lastname')};
  STRING15 MiddleName{xpath('middlename')};
  STRING5  Zip{xpath('zip')};
  STRING42 Street{xpath('street')};
  STRING20 City{xpath('city')};
  STRING2  State{xpath('state')};
END;

ip := 'http://10.173.248.5:9876/';  //training cluster
//ip := 'http://192.168.229.131:9876/'; //my one-way ROXIE VM
svc:= 'FetchPeopleByZipService';
OUTPUT(SOAPCALL(ip, svc,{STRING10 ZIPValue := '63033'},DATASET(outRecord)));


For a single node VM ROXIE, the base address and port 9876 is all you need.

For physical clusters with multiple nodes, you need to access any one of the ROXIE nodes target IP address, and again use the 9876 port.

Developers actually do their own "load balancing" by randomly selecting a node on each call. For example, on a 100-way ROXIE:

Code: Select all
ip:='http://10.173.219.' + (STRING)(random() % 100 + 1) + ':9876';


Anyway, it works great when you have the right port! :-)

Regards,

Bob
bforeman
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1002
Joined: Wed Jun 29, 2011 7:13 pm

Wed Nov 13, 2013 4:05 pm Change Time Zone

...and to add one more point

To access the query via WSECL you just need to extend the directory a bit more, like this:

Code: Select all
ip := 'http://192.168.229.131:8002/WsEcl/soap/query/roxie/FetchPeopleByZipService'


Accessing the Roxie query through WsECL gives you an automatic round robin load distribution among your Roxie servers (farmers).

Thanks to Tony Fishbeck and Jim Defabia for this input.

Regards,

Bob
bforeman
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1002
Joined: Wed Jun 29, 2011 7:13 pm

Thu Nov 14, 2013 2:01 pm Change Time Zone

Yes, this is how I am calling too. My function errored out even after I made it 9876. But, this time around, I noticed lot more activity in the log file - I'll send it to you in a mail - can you let me know if you can infer anything from the logs?

Regards,
Gayathri
Gayathri_Jayaraman
 
Posts: 75
Joined: Wed May 08, 2013 5:03 am

Thu Nov 14, 2013 2:15 pm Change Time Zone

Logs are good, and I can forward them to the development team, and the ECL code is also good to send.
bforeman
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1002
Joined: Wed Jun 29, 2011 7:13 pm

Thu Nov 14, 2013 3:03 pm Change Time Zone

Your code example works fine here. I think you just need to adjust your RoxieIP definition as follows:

Code: Select all
RoxieIP := 'http://192.168.11.131:8002/WsEcl/soap/query/roxie/getwordcount';
bforeman
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1002
Joined: Wed Jun 29, 2011 7:13 pm

Tue Nov 19, 2013 12:19 pm Change Time Zone

It worked great Bob. Thanks so much!
Gayathri_Jayaraman
 
Posts: 75
Joined: Wed May 08, 2013 5:03 am


Return to Online Classroom

Who is online

Users browsing this forum: No registered users and 1 guest