简体   繁体   English

jQuery发送时发送的xml数据被修剪

[英]jQuery posting xml data getting trimmed while sending

I am posting xml data to server which is working fine in my local, but after uploaded to server, its breaking the data at client side I hope. 我正在将xml数据发布到服务器,该服务器在我的本地服务器上运行良好,但是将其上传到服务器后,希望在客户端中断数据。

Request payload in my local server 在我的本地服务器中请求有效负载

<ApiRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <ApiKey>xxxxxxxxxxx</ApiKey>
  <Data xsi:type="Subscriber">
    <Mode>AddAndUpdate</Mode>
    <Force>true</Force>
    <ListId>16</ListId>
    <Email>abc@gmail.com</Email>
    <Firstname>abc</Firstname>
    <Lastname>cdf</Lastname>
  </Data>
</ApiRequest>

在此处输入图片说明

Request payload after uploading to server 上载到服务器后请求有效负载

<ApiRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <ApiKey>xxxxxxxxxxx
  <Data xsi:type="Subscriber">
  <Mode>AddAndUpdate
  <Force>true
  <ListId>16
  <Email>abc@gmail.com
  <Firstname>abc
  <Lastname>cdf

在此处输入图片说明

This is integration of ExpertSender . 这是ExpertSender的集成。 files are hosted in Acquia Cloud. 文件托管在Acquia Cloud中。

What could be the possibility of this issue? 此问题可能是什么? How can I solve this? 我该如何解决?

This is my Post call code, 这是我的邮递区号,

var postData = '<ApiRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema"><ApiKey>xxxxxxx</ApiKey><Data xsi:type="Subscriber"><Mode>AddAndUpdate</Mode><Force>true</Force><ListId>16</ListId><Email>'+emailVal+'</Email><Firstname>'+firstnameVal+'</Firstname><Lastname>'+lastnameVal+'</Lastname><Properties><Property><Id>1</Id><Value xsi:type="xs:integer">'+telVal+'</Value></Property></Properties></Data></ApiRequest>';
    var postUrl = 'https://api2.esv2.com/Api/Subscribers';
    jQuery.ajax({
        type: "POST",
        url: postUrl,
        data: postData,
        contentType: "text/plain; charset=utf-8",
        cache: false,
        success: function(response) {
            success.html(sucessMsg);
        },
        error: function(response) {
          var xmlData = jQuery.parseXML( response.responseText );
          var message = jQuery( xmlData ).find("Message").text();
          if (message.search("Email is invalid")){
            failed.html(errorMsg);
          }else{
            failed.html(message);
          }
        }
    });

It was the text editor configuration. 这是文本编辑器的配置。

In Drupal-8, the "mail text" text editor's "Correct faulty and chopped off HTML" option actually doing crazy with XML content. 在Drupal-8中,“邮件文本”文本编辑器的“更正错误并砍掉HTML”选项实际上使XML内容疯狂。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM