Skip to content Skip to sidebar Skip to footer

Soap Request In Parse Cloud Code

I need to make a SOAP request in parse cloud code. Then I save returned data to a parse class. I am new at javascript. I tried to do it with Parse.Cloud.httpRequest but it did not

Solution 1:

I solved the problem according to the question :

Parse.com to communicate with WSDL

here it is :

Parse.Cloud.define("Uedas", function(request, response) {

                   var filterPlanliKesintiler = false;

                   var listName = "PlanliKesintiler";

                   var where = (filterPlanliKesintiler) ?
                   "<And><Geq><FieldRefName='Tarih' /><ValueType='DateTime'><TodayOffsetDays='-30' /></Value></Geq><Eq><FieldRefName='Aktif' /><ValueType='Boolean'>1</Value></Eq></And>" :
                   "<Eq><FieldRefName='Aktif' /><ValueType='Boolean'>1</Value></Eq>";

                   var Buffer = require('buffer').Buffer;

                   buffer = new Buffer(
                                       "<soapenv:Envelopexmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
                                       <soapenv:Body> \
                                       <GetListItemsxmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
                                       <listName>"+listName+"</listName> \
                                       <query> \
                                       <Query> \
                                       <OrderBy> \
                                       <FieldRefName='Tarih'Type='DateTime'IncludeTimeValue='FALSE'Ascending='False' /> \
                                       </OrderBy> \
                                       <Where> \
                                       " + where + " \
                                       </Where> \
                                       </Query> \
                                       </query> \
                                       <viewFields> \
                                       <ViewFields> \
                                       <FieldRefName='Tarih' /> \
                                       <FieldRefName='BaslangicSaat' /> \
                                       <FieldRefName='BitisSaat' /> \
                                       <FieldRefName='Planl_x0131__x0020_Kesinti_x0020' /> \
                                       <FieldRefName='Bolgeler' /> \
                                       <FieldRefName='KesintiNedeni' /> \
                                       <FieldRefName='Aktif' /> \
                                       <FieldRefName='AboneSayisi' /> \
                                       </ViewFields> \
                                       </viewFields> \
                                       <rowLimit>0</rowLimit> \
                                       </GetListItems> \
                                       </soapenv:Body> \
                                       </soapenv:Envelope>"

                                       );



                   Parse.Cloud.httpRequest({
                                           method: 'POST',
                                           url: 'http://www.sedas.com/tr-tr/Bilgi_Danisma/_vti_bin/lists.asmx',
                                           headers: {
                                           'Content-Type': 'text/xml; charset=utf-8'
                                           },
                                           body: buffer
                                           }).then(function(httpResponse) {
                                                   // success
                                  response.success(httpResponse.text);

                                                   },function(httpResponse) {
                                                   // error
                                                   response.error(httpResponse.text);
                                                   });


                   });

Post a Comment for "Soap Request In Parse Cloud Code"