I have a requirement to be able to pull data from a repeating table on an InfoPath form and put it into a report. I found a solution file on Codeplex that will read the data out of the repeating table and output it as XML via a SOAP query. I'm trying to read the SOAP query and output it to a web page via JQuery in a CEWP. I'm fairly new to trying this and I'm a little lost on how to approach this. The web service presents this example code:
POST /_vti_bin/InfoPathDB/InfoPathDB.asmx HTTP/1.1
Host: 10.158.2.5
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<QueryFormLibrary xmlns="http://infopathdb.codeplex.com/">
<SiteURL>string</SiteURL>
<FormLibraryTitle>string</FormLibraryTitle>
<OptionalContentType>string</OptionalContentType>
<OptionalCAMLFilter>string</OptionalCAMLFilter>
<OptionalBooleanIncludeAttachments>string</OptionalBooleanIncludeAttachments>
</QueryFormLibrary>
</soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<QueryFormLibraryResponse xmlns="http://infopathdb.codeplex.com/">
<QueryFormLibraryResult>xml</QueryFormLibraryResult>
</QueryFormLibraryResponse>
</soap12:Body>
</soap12:Envelope>
My code block I'm adapting is below. I'm not sure how to shoehorn the example code into my Jquery block, if it is even the right way to go about doing it. Can I test the SOAP query by itself in a CEWP without embedding it in a Jquery block?
<script src="/Site_Assets/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var soapEnv =
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<QueryFormLibrary xmlns="http://infopathdb.codeplex.com/">
<SiteURL>http://255.255.255.1</SiteURL>
<FormLibraryTitle>List Entries</FormLibraryTitle>
</QueryFormLibrary>
</soap12:Body>
</soap12:Envelope>";
$.ajax({
url: "/_vti_bin/InfoPathDB/InfoPathDB.asmx HTTP/1.1",
type: "POST",
dataType: "xml",
data: soapEnv,
complete: processResult,
contentType: "text/xml; charset=\"utf-8\""
});
});
// some code that writes the output to the page
}</script>
Any pointers on what I'm doing wrong/right?