Autor Beitrag
ebber
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 239
Erhaltene Danke: 1

Win XP, Win 7
C# (VS 2010), Delphi (2007), Expression 4
BeitragVerfasst: Mi 11.02.09 17:42 
Hallo,

ich versuche von einer ASP.net Seite auf eines meiner Programme zuzugreifen. Also ich möchte eine Funktion aufrufen, die mir dann etwas zurück gibt.

Das Programm:
ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
            serviceUrl = "http://" + "localhost" + ":4488/RsHAccess";

            host = new ServiceHost(typeof(RsHAccess));

            WSHttpBinding webHttpB = new WSHttpBinding();

            host.AddServiceEndpoint(typeof(IRsHAccess), webHttpB, serviceUrl);

            try
            {
                host.Open();
            }
            catch (Exception ex)


ASP.net
ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
        EndpointAddress endpointAddress = new EndpointAddress("http://" + "localhost" + ":4488/RsHAccess");

        System.ServiceModel.WebHttpBinding webHttpB = new WebHttpBinding();
        webHttpB.OpenTimeout = TimeSpan.FromSeconds(10);

        IRsHAccess chan = ChannelFactory<IRsHAccess>.CreateChannel(webHttpB, endpointAddress); // Exception 

        using (chan as IDisposable)
        {
            string s = chan.GetSth();
        }


Ich dachte ich bräuchte jetzt eine Http Verbindung, damit das mit ASP.net funktioniert?
Aber jetzt kommt diese Exception:

ausblenden Quelltext
1:
Manuelle Adressierung ist für diese Factory aktiviert, daher müssen alle gesendeten Nachrichten voradressiert sein.					


Ich bin mir auch nicht so sicher was das zu bedeuten hat?
Kann mir da jemand helfen?

MfG