Advertisement

01.17.2008 at 09:43AM PST, ID: 23090913
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

Cross domain issue?

Asked by DanaGray in Secure Socket Layer (SSL) & HTTPS, Extensible Markup Language (XML), Visual Studio

Tags: , , , ,

I am working on a client's project that will provide a realtime experience of their VOIP system. A user will enter their phone number into an input box in a form on the web page and they will receive a call from the VOIP system that will automatically connect them with a sales rep from the company.  They have provided a https URL to a REST-like web service that does the heavy work. I only need to connect to the web service and pass an xml structure with the phone number. I initially used classic asp (as the rest of the web site is asp) and an MSXML2.ServerXMLHTTP.4.0 object. Got the error message:
msxml4.dll error '80072efd'
A connection with the server could not be established
Tried numerous combinations with the headers etc,no luck. But I don't think that is the issue.
Finally tried .net and making the http request through 'System.Net.WebClient' (see the attached code snippet) Now here is the interesting/weird part.
From Visual Web Dev Express 2005 if I 'View in Browser' and hit the page it works just peachy (http://localhost:2733/Site/Sample-Our-Sound/post.aspx). If I open my browser and point to the dev server page (http://vintalk.sitelab.net/Sample-Our-Sound/post.aspx)...no worky. If I open my browser and point to the page (I have installed the site there as well) on my local machine (http://localhost/WebSite/Default.aspx) it works. Both my machine and the dev server are in the same LAN behind a firewall and the service the application connects to is on the clients server. Now not being familiar with what exactly happens when the 'View in Browser' is envoked nor much about proxy servers and cross domain issues I can't say that is where the issue lies, but that is my feeling. Something about the browser making the request to the 'localhost'?
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
code behind...
Imports Microsoft.VisualBasic
Imports System.Net
Imports System.Net.Security
Imports System.Security.Cryptography.X509Certificates
Imports System.Web.Security
 
Partial Class _Default
    Inherits System.Web.UI.Page
 
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim mypost As New XMLTest
        Dim RESPONSE_TEXT As String = "<xml><set><callrequest_update><request>Call-Say-Time</request><request_id>xxxxxxx</request_id><orig_address>xxxxx</orig_address><request_address>xxxxxx</request_address><request_status>pending</request_status></callrequest_update></set><src></src></xml>"
        TextBox1.Text = mypost.sendPost(RESPONSE_TEXT)
    End Sub
End Class
Public Class XMLTest
    Public Const URL_BASE = "https://sanvtest.vincomm.net/tac/SiPbxDomain?kind=subscriber_config"
    Public Const RSP_USERNAME As String = "xxxxx"
    Public Const RSP_PASSWORD As String = "xxxxx"
    Public Const PRIVATE_KEY = "Enter Private Key"
    Public Function sendPost(ByVal str As String)
        Dim myHttpWebRequest As New System.Net.WebClient
        Dim rs As String = ""
        Dim myCache As New CredentialCache
        myCache.Add(New Uri(URL_BASE), "Basic", New NetworkCredential(RSP_USERNAME, RSP_PASSWORD))
 
        myHttpWebRequest.Credentials = myCache
 
        System.Net.ServicePointManager.ServerCertificateValidationCallback = New RemoteCertificateValidationCallback(AddressOf ValidateServerCertificate)
        myHttpWebRequest.Headers.Add("Content-Type", "text/xml")
        Try
            Dim sendData As Byte() = System.Text.Encoding.ASCII.GetBytes(str)
            Dim myHttpResponse As Byte() = myHttpWebRequest.UploadData(URL_BASE, "POST", sendData)
            rs = System.Text.Encoding.ASCII.GetString(myHttpResponse)
        Catch ex As Exception
            rs = "err:" + rs
        End Try
        Return rs
    End Function
    'Used to convert to MD5
    Public Function cMD5(ByVal str As String) As String
        'Must have Imports System.Web.Security in General Declarations
        Dim Hash As String = FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5")
        Return Hash.ToLower
    End Function
    Public Shared Function ValidateServerCertificate(ByVal sender As Object, ByVal certificate As X509Certificate, ByVal chain As X509Chain, ByVal sslPolicyErrors As SslPolicyErrors) As Boolean
        Return True
    End Function
End Class
[+][-]01.18.2008 at 10:42PM PST, ID: 20696434

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.21.2008 at 09:10AM PST, ID: 20707582

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.23.2008 at 03:45PM PST, ID: 20729182

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.24.2008 at 10:56AM PST, ID: 20736050

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.30.2008 at 03:45PM PST, ID: 20782771

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.01.2008 at 09:12AM PST, ID: 20798464

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Secure Socket Layer (SSL) & HTTPS, Extensible Markup Language (XML), Visual Studio
Tags: vb.net,asp, ie, http://vintalk.sitelab.net/Sample-Our-Sound/post.aspx, msxml4.dll error '80072efd' A connection with the server could not be established, Connection succeeds when 'View in Browser' opened from Visual Web Dev Express 2005
Sign Up Now!
Solution Provided By: DanaGray
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080924-EE-VQP-38 / EE_QW_2_20070628