Join our DNN Community    (Newsletter, Tips, Tricks and Forums for DNN Skins & Modules)

 


 
Microsoft Gold Certified Partner - DNN Benefactor

DotNetNuke Powered! 


Monday, December 01, 2008 Register · Login · Contact · Search:  
Company Solutions Portfolio Contact
Forums
General
The ever-powerful ListX module forum. Post your questions, new configuration ideas and reviews.
Subject: Soap automation help

You are not authorized to post a reply.   
Author Messages
adski74
Welterweight
Posts:27

09/21/2008 12:15 PM Alert 
A client wants us to automate the mass import of users into a newsletter system that has a soap api.

They will be automating a csv file of users data to be uploaded to our web server once a week.

The csv file will have each users first name, last name & email address. The newsletter system will automatically handle duplicates.

We can get the soap working well to import multiple users using the script below:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>

<Subscriber.Add xmlns="http://api.mysite.com/api/">
<ApiKey>098hv9gf090gfd6564dgfd</ApiKey>
<ListID>gfd654dgfd4wut5h7</ListID>
<Email>contact@myemail-1.com</Email>
<Name>Joe Smith</Name>
</Subscriber.Add>

<Subscriber.Add xmlns="http://api.mysite.com/api/">
<ApiKey>098hv9gf090gfd6564dgfd</ApiKey>
<ListID>gfd654dgfd4wut5h7</ListID>
<Email>contact@myemail-2.com</Email>
<Name>Sally Smith</Name>
</Subscriber.Add>

</soap:Body>
</soap:Envelope>

My questions are:

1. What would be the best method be the best method to extract the user data from the csv file?

2. Can we use some type of array in the soap script above to hold multiple users data? Can you give us an example?

3. How many users could we import at one time? Would it time out for large imports? The max amount of imports at any given time should be about 4000 users.

Any ideas/help is greatly appreciated.
bgates
Heavyweight
Posts:197

10/05/2008 12:41 PM Alert 
Data import is always tricky. Unfortunately, ListX doesn't treat CSV files as a data source. Your best bet is to import the CSV into a data table with the same structure as the CSV. Then, do a SELECT * FROM that table in a Execute action, and add your SOAP calls as children.

The Import action will take in a form value, and for every record, execute the SQL statement you define. You'll want to dump each record into a table. Note, this cannot be a TEMPORARY table (#tblMyData) because that temp table won't be available on the next statement.

The next action after the Import action should be a simple query execution for SELECT * FROM tblMyData (or whatever it was) and name the action ImportedData.

Then, add an Input action as a child of the query execution. That way, it'll make the web service call for every record that was imported. The SOAP field should be something like:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>

<Subscriber.Add xmlns="http://api.mysite.com/api/">
<ApiKey>[APIKey,ImportedData]</ApiKey>
<ListID>[ListID,ImportedData]</ListID>
<Email>[Email,ImportedData]</Email>
<Name>[Name,ImportedData]</Name>
</Subscriber.Add>

</soap:Body>
</soap:Envelope>

Then do whatever it is you need to with the result of that call.

When developing this, definitely use a very small file to start with. Much easier to debug on 3 records, than 3000. Good luck.

Bob Gates
Business Intelligence Force, Inc. (bi4ce)
adski74
Welterweight
Posts:27

10/07/2008 4:03 AM Alert 
Great. I will give it a shot later this week!

Thanks for the tips!!
jliptak
Heavyweight
Posts:162

10/25/2008 10:10 AM Alert 
The attached listx will read a CSV file. In the sample provided, place the data file in the portal root & give it a try.

Cheers
John

Attachment: ListxCsv.zip

You are not authorized to post a reply.
Forums > Bi4ce.Modules.ListX > General > Soap automation help



ActiveForums 3.6
Latest Post
 
At R2integrated (formerly Bi4ce), we take support seriously.  That's why we support our customers and DNN community with daily monitoring from our experienced engineering team.  We ask that the first step taken is to read the relevant documentation and support forums prior to submitting any questions that may already be available or have been answered.  We ask that you review the documentation that we provide for our products before posting a question.

The Forums are for our customers to chat, exchange ideas and strategies, and submit feedback.  Please be sure to perform keyword searches for previous related forum responses.

To be helpful when submitting a new item, please include the following: 
  1. DNN Version
  2. Module Version
  3. Admin Log Viewer Information
  4. Environment detail: Operating system, .NET framework version, database and version, IIS version, Browser version (if appropriate)
We always try to respond quickly and monitor the forums daily during business hours (EST).  Occasionally, requests for a specific project requirement may not apply for the free support offered. For project specific support please submit via our Information Request form.

Thank you for using our Forums.

Click here to register for the Forums
 
© 2008 by R2integrated (formerly Bi4ce) | DNN® is a registered trademark of DotNetNuke Corporation