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:
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
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); 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:
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