cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2425
Views
2
Helpful
7
Replies

Using ASP.NET 4.5/IIS 7/MVC 5/Web API 2/Ajax (URL Rewrite reverse proxy) to call Finesse Server

Hi,
I am new to developing in Finesse. I was following an example  (non gadget) to write an ASP.NET web app. Using JQuery 1.10 from VS2013
On the browsers address bar it works fine (I have to enter the credentials first before the XML result is displayed)
f I use ajax, it fails with a 415 error:
415_error001.jpg
Below is the code I used to do the call. Passing all args to ajax properly here:
JAVASCRIPTCODE.JPG
Here are the headers from fiddler:
fiddler.JPG
So I have 2 issues:
1. How do I suppress the login dialog for basic Authorization, even if all headers were submitted correctly?
I am already passing the token to ajax and yet the pop out still appears.
JAVASCRIPTCODE_001.JPG
2. I get a 415 error response after authenticating using the popup dialog
Can you please help me to resolve these issues?
Appreciate it.
Jason
7 Replies 7

ewindgat
Level 5
Level 5

How about we try these ideas for making the jQuery call work.

  1. Browsers often append to the contentType (unknown to you). Which is why it might work in a browser. Try fully qualifying the contentType, for example add …charset=utf-8 (for example: “application/xml; charset=utf-8”), or do not set the contentType, and let jQuery provide a default value.

  2. You may need the headers set (json or xml)…

headers: {

        'Accept': 'application/json',

        'Content-Type': 'application/json'

    },

  1. Or, simplify the “accept” option, to json or xml.

Thanks I got it to work beautifully. The login dialog was suppressed and I was able to get an XML back from the ajax call

Using these ajax options:

Now I am trying to connect jabber getting this error when connecting. Any ideas? Am I sending the incorrect values/format?

With this call

These are the values being passed:

Could you debug in to the error, using Firebug in Firefox, or example. Try to see the value and what errors specifically are being sent. For example, what is the value of xmlstr.

It is probably not an issue with the jabberwersk.js file. I might be some setting, or how it is being used.

Here it is:

"<wrapper><body xmlns=\"http://jabber.org/protocol/httpbind\"
xmlns:NS1=\"\" NS1:xmlns:xmpp=\"urn:xmpp:xbosh\"
hold=\"1\" ver=\"1.9\" to=\"localhost\"
secure=\"true\" wait=\"30\" xmlns:NS2=\"\"
NS2:xmpp:version=\"1.0\" rid=\"1342545527\" /></wrapper>
<wrapper><body xmlns=\"http://jabber.org/protocol/httpbind\" xmlns:NS1=\"\" NS1:xmlns:xmpp=\"urn:xmpp:xbosh\" hold=\"1\" ver=\"1.9\" to=\"localhost\" secure=\"true\" wait=\"30\" xmlns:NS2=\"\" NS2:xmpp:version=\"1.0\" rid=\"1342545527\" /></wrapper>"

I apologize if I am not understanding the issue.

From reading the above returned XML, it don't see the error. is it just that there is no content? Is this the complete XML (is it SOAP)?

You will need to parse out the XML to find a response. And, there might not be a response with content, if a message was not created.

Hello,

After line 72 is called, it throws TypeError exception:

Its throwing TypeError exception once the XML string response is being parsed.

That XML string in the variable xmlstr was

""

So somehow the response from the Connect() is returning back an invalid XML string.

Thanks,

Jason Gonzales

1500 Dale Mabry HWY. Tampa, FL 33629

O 813.258.7055

C 813.657.6636

Is the XML you cut and pasted above, the entire XML being returned that is causing the problems, starting with <wrapper>?

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: