We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

pushing survey data

Questions and answers about Plum Survey

Moderators: admin, support

Post Reply
webtiers
Posts: 6
Joined: Sun Feb 28, 2010 6:36 pm

pushing survey data

Post by webtiers »

Can you support a push model where for each survey response, you automatically make a web service call to a web service we publish on one of our servers? We could work with your existing data model used in your exiting SOAP service: http://survey.plumvoice.com/ws/export-r ... s.php?WSDL.

Today we pull data from you using your service: http://survey.plumvoice.com/ws/export-r ... s.php?WSDL, by polling every few minutes or so. We prefer that you dynamically push data to us.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

use webservice question type and cookies on IVR survey pages

Post by support »

Hi there,

To do this, you can put in a webservice question for IVR on each of your IVR survey pages and use cookies to chain them together.

Details explaining how you can do this can be found in this previous post.

Regards,
Plum Support

webtiers
Posts: 6
Joined: Sun Feb 28, 2010 6:36 pm

Re: pushing survey data

Post by webtiers »

so if I have a survey with 17 questions, you have to make 17 web service calls for one survey response, correct?

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: pushing survey data

Post by support »

Hi,

No, you wouldn't have to make 17 web service calls for one survey response.

Instead, depending on the number of pages in your survey, you would only need one SOAP webservice question for each page in your survey.

Please keep in mind of the following:

"You should provide a WSDL for your SOAP service that specifies only one function named plumEval. This function will receive two arrays of strings: one with the text of each question on the current page, and the other with all the answers received on the current page. These arrays will be indexed in the same fashion, where each array's elements will be ordered so that the questions correspond with the answers. This function should return a string, which will be saved as the response for the question calling this webservice."

Please reference this documentation for further help.

Regards,
Plum Support

webtiers
Posts: 6
Joined: Sun Feb 28, 2010 6:36 pm

Re: pushing survey data

Post by webtiers »

Ok I understand now. Thanks. So I wrote a simple service in ASP.NET using C#. When I test my survey with:
http://websurvey.plumvoice.com/take/1952-89884960?c

I always get a 500 Internal Server error. My service wsdl is at:

http://www.webtiers.com/RSFSurveyServic ... .asmx?wsdl

Can you help me understand why I am getting this error?

Thanks.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: pushing survey data

Post by support »

Hi,

Your webservice and WSDL were fine. After testing this out a bit, we've noticed that .NET SOAP services seem to insist on returning scalar values wrapped in objects instead of just the scalar value itself... we weren't gracefully handling this scenario. After pushing out a patch to unwrap such return values, your service seems to be working with Plum Survey. Please try it out again and tell us how it goes...

Hope this helps,
Plum Support

webtiers
Posts: 6
Joined: Sun Feb 28, 2010 6:36 pm

Re: pushing survey data

Post by webtiers »

Yes this is working now. Thanks for such a quick and professional response!

I have trouble retrieving your Cookie with:
string ip = Server.HtmlEncode(Context.Request.Cookies["ip"].Value);

Now I am having an issue reading the string arrays that are passed in. In my C# code I have:

public string plumEval(string[] question_texts, string[] answers)

Then further on I do:

foreach (string q in question_texts)
{
s.WriteLine(q);
}
But I continue to trap an Exception:
Error: Object reference not set to an instance of an object.

It looks like the PHP string array type is not compatible with the C# equivalent. I seemed to have run into this before, but have forgotten a solution. Any help would be greatly appreciated.

Thanks, Mike

webtiers
Posts: 6
Joined: Sun Feb 28, 2010 6:36 pm

Re: pushing survey data

Post by webtiers »

Retireving the cookie works fine. The issue I am having is getting values from the string arrays that are passed in from your PHP client.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: pushing survey data

Post by support »

Hi,

Sorry, but as we lack any in-house expertise with C#, we wouldn't be able to help you directly on how to get the values from the string arrays for C#.

You could try using introspection to see exactly what is getting passed into those parameters. If this doesn't work for you, you could try parsing the values directly out of the XML.

Regards,
Plum Support

rvafadar
Posts: 4
Joined: Thu Nov 04, 2010 9:32 am

Re: pushing survey data

Post by rvafadar »

I am having an issue reading the string arrays that are passed in. In my C# code I have:

public string plumEval(string[] question_texts, string[] answers)

Then further on I do:

foreach (string q in question_texts)
{
s.WriteLine(q);
}
Both question_texts, answers are empty!!!

It looks like the PHP string array type is not compatible with the C# equivalent. . Any help would be greatly appreciated.

Thanks, Rita

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: pushing survey data

Post by support »

Hi Rita,

Sorry, but as mentioned in our previous post, we don't have any in-house expertise to help you with your C# code. Perhaps other developers who have worked with C# in this forum can assist you.

However, you could try using introspection to see exactly what is getting passed into those parameters. If this doesn't work for you, you could try parsing the values directly out of the XML.

Regards,
Plum Support

Post Reply