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

Configuring SOAP Webservice

Questions and answers about Plum Insight

Moderators: admin, support

Post Reply
Wayside
Posts: 4
Joined: Wed Nov 25, 2015 11:27 am

Configuring SOAP Webservice

Post by Wayside »

I need more information on how to use the SAOP Webservice question on an Insight survey. I have placed this as the last item in the survey with the intention of capturing all survey responses and sending them to a service on our end that will parse them into a database. I have several questions about this:
  • From what I gather in the forums, the data will be sent as 2 string arrays, one for question text the other for the answers. So the service on my end (ASMX in ASP.NET) should expect two string array parameters. Is this correct?
  • I would like to test my service using the SOAP Tester tool, but don’t seem to be able to figure out how to configure the test parameters to conform to this format.
  • Is there a way to use hidden field names rather than the actual question text?
  • Is there a way to embed a static value in the SOAP request that would be unique to each survey and never appear to the responder in any way?
Thank you.

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

Re: Configuring SOAP Webservice

Post by support »

Hi,

Yes, you are correct that the data is sent as two parallel string arrays, one being an array of the question text and the other being the answers to each question, so your service should expect two separate string arrays. With complex types like string arrays, you won't be able to test this with the soap tester. There is no way to hide the question text in the request, no, they will always be sent as displayed in the question text for the question (in the default language for the survey).

Regarding the unique value with each requests, we're currently in the process of expanding the web service type to support SOAP and REST, as well as adding additional parameters to the requests. This release will add three additional parameters in the SOAP request: ani_ip, dnis, and session_id (all of type string). ani_ip will be the ip address or ani of the caller (depending on whether it was taken via phone or web). Dnis will be the number dialed by the caller or an empty value if taken via web. session_id will be a unique id that will uniquely identify the call or web session. This value will be transparent to the caller. If you wanted to configure responses on a per-survey level, you could either make separate services for each survey, or utilize this dnis value and assign specific surveys to specific phone numbers, once this is a live feature. The session_id value should give you what you're looking for in terms of uniqueness per call, but no, there is no way to embed values into the soap request itself. These additional parameters are currently in testing and we hope to have those rolled out in the near future.

Please let us know if you have any additional questions.

Regards,
Plum Support

Wayside
Posts: 4
Joined: Wed Nov 25, 2015 11:27 am

Re: Configuring SOAP Webservice

Post by Wayside »

Thank you for those details. It does look like I would have to use the dnis to link surveys to various different campaigns. Can you tell me when you expect the new version to be released?

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

Re: Configuring SOAP Webservice

Post by support »

Hi,

We do not yet have a definite ETA for these features, though we hope to have them available by early in the coming year.

Regards,
Plum Support

Wayside
Posts: 4
Joined: Wed Nov 25, 2015 11:27 am

Re: Configuring SOAP Webservice

Post by Wayside »

One more service related question. Given the WSDL of http://api.iddm.ca/ivr/plum.asmx?wsdl how should the Post method be referenced in the survey’s Soap web service element? While I can see your side hitting my server, the code in Post never seems to fire.

Thank you.

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

Re: Configuring SOAP Webservice

Post by support »

Hi,

The data integration documentation is also coming with this new release, but for the time being, the documentation for the older survey tool is still applicable for how to integrate with this SOAP webservice question type. The details can be found here:

http://www.plumvoice.com/docs/surveys/s ... .htm?frame

There is also a sample web service and WSDL available here:
http://survey.plumvoice.com/ws/sample-w ... e.php?WSDL
http://survey.plumvoice.com/ws/sample-webservice.php

Essentially, you'll need a post function to match this signature (as that's the method that's being called internally through Insight):
plumEval($question_texts, $answers)

Hopefully that helps, but please let us know if you have any further questions.

Regards,
Plum Support

Wayside
Posts: 4
Joined: Wed Nov 25, 2015 11:27 am

Re: Configuring SOAP Webservice

Post by Wayside »

I’ve been held up with various other projects, and am finally looking at this again. I have constructed my service in ASP.NET at http://api.iddm.ca/ivr/plum.asmx?wsdl It responds and works correctly when I access it, but nothing I do in my survey seems to trigger it. Can you tell from the signature what might be amiss?

Relevant portion of the actual code:

Code: Select all

namespace ResultsAPI.IVR
{
	/// <summary>
	/// Summary description for Plum
	/// </summary>
	[WebService(Namespace = "http://api.iddm.ca/ivr/plum/")]
	[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
	[System.ComponentModel.ToolboxItem(false)]
	[SoapDocumentService(RoutingStyle=SoapServiceRoutingStyle.RequestElement)]
	// 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 Plum : System.Web.Services.WebService
	{

		[WebMethod]
		[SoapDocumentMethod(Action = "http://api.iddm.ca/ivr/plum/plumEval")]
		//public void Post(String[] qst, String[] ast)
		public string plumEval(String[] qst, String[] ast)
		{
			// Process data
		}

............

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

Re: Configuring SOAP Webservice

Post by support »

Hello,

It looks like your parameters are formatted a little differently, here's a sample of a WSDL that we know works to consume this service:

Code: Select all

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:typens="urn:SoapWebservice" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="SoapWebservice" targetNamespace="urn:SoapWebservice">
<types>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:SoapWebservice">
<xsd:complexType name="ArrayOfstring">
<xsd:complexContent>
<xsd:restriction base="soapenc:Array">
<xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
</types>
<message name="plumEval">
<part name="question_texts" type="typens:ArrayOfstring"/>
<part name="answers" type="typens:ArrayOfstring"/>
<part name="ani_ip" type="xsd:string"/>
<part name="dnis" type="xsd:string"/>
<part name="session_id" type="xsd:string"/>
</message>
<message name="plumEvalResponse">
<part name="plumEvalResponse" type="xsd:string"/>
</message>
<portType name="SoapWebservicePort">
<operation name="plumEval">
<documentation>
The WSDL that you use should specify only one function named "plumEval". This function will receive two arrays of strings and three strings. The arrays will be paralell arrays, one with the text of each question, and the other with all the answers received on the current page. The three strings consist of ani_ip, dnis, and session_id. This data is realted to the specific session of one user taking a survey. This function should return a string, which will be saved as the response for the webservice question calling this webservice. If there is a choice with skip logic that corresponds to this answer, it will be followed. If a SOAP fault is returned, Plum Insight will store SOAPFault as the answer data for the webservice question and you can use this value in your skip logic, if desired.
</documentation>
<input message="typens:plumEval"/>
<output message="typens:plumEvalResponse"/>
</operation>
</portType>
<binding name="SoapWebserviceBinding" type="typens:SoapWebservicePort">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="plumEval">
<soap:operation soapAction="urn:SoapWebserviceAction"/>
<input>
<soap:body use="encoded" namespace="urn:http://example.com" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="urn:http://example.com" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="SoapWebservice">
<port name="SoapWebservicePort" binding="typens:SoapWebserviceBinding">
<soap:address location="example.com"/>
</port>
</service>
</definitions>
Hope this helps, please let us know if you need anything else.

Regards,
Plum Support

shimmer
Posts: 1
Joined: Mon Aug 20, 2018 8:35 am
Contact:

Re: Configuring SOAP Webservice

Post by shimmer »

had the same problem with the help of you guys it is solved now thank you

Post Reply