tags:

views:

19

answers:

1

hi,

I am sending xml from jquery ajax method to WCF method replacing all special characters.

my jquery method structure is :

function UpdateUserProfile(UserId ) {

    var reqParams = {

        LinkedinUrl:$("#hdnProf").val(),
        LinkedinFeed:$("#hdnfeed").val()
    };
}

var reqParams_Serialized = Sys.Serialization.JavaScriptSerializer.serialize(reqParams);

$.ajax({
    url: servicepath + "xyz.svc/mymethod",
    type: 'Post',
    processData: false,
    contentType: 'application/json;charset=utf-8',
    data: reqParams_Serialized,
    cache: false,
    success: function(response) {

    },
    failure: function(response) {

    }
});

}

Iam getting an Problem . If the length of xml increases jquery method does not make hit to WCF method. Also this problem occurs for some users xml. any suggestion or alternative way to send xml.

A: 

In some cases there are problems sending xml over WCF, it gets confused with an XML document inside an XML document (my understanding of the root of the problem)

The way we get around this is to convert the xml into a string, send it over the wire, and then convert it back to xml on the other side.

Shiraz Bhaiji