Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Call VB.net webservice from cross domain

$
0
0

Hi . I have had a vb.net service working for a few years now. Its very simple:

<WebMethod()>
        Public Function ReportComplete(SaltID As String) As String

            Dim db As New AppDataClassesDataContext

            Dim act As Activity = (From ax In db.Activities
                                   Where ax.AlternateID = SaltID
                                   Select ax).First

            Dim am As New AssignmentManager
        am.CompleteActivity(act.ID)

        Return "OK"

        End Function

I was making this call from web browser using Jquery:

functionReportComplete(){varId;Id= readCookie("CID");/* alert("ID: " + Id); */$.ajax({
        type:"POST",
        url:"../../../PlayerComm.asmx/ReportComplete",
        data:"{'SaltID':'"+Id+"'}",
        contentType:"application/json",
        dataType:"json",
        success:function(msg){/* alert(msg.d); */},
        error:function(xhr, err){
            alert("Error occured when reporting complete: "+ xhr.responseText);}})}

This has been working great. But a change is coming. I now have to perform this POST to a different domain, which I understand is prohibited for security reasons.

I have read about JSONP, but it doesn't allow Posts apparently?

My head is exploding! Should I be using a different approach? Please help.

Thanks

Cory


Viewing all articles
Browse latest Browse all 5678

Trending Articles