Entwickler-Ecke

Netzwerk - http POST REQUEST an TOMCAT-(bin Anfänger)


melanie75 - Mo 24.09.07 11:26
Titel: http POST REQUEST an TOMCAT-(bin Anfänger)
Hallo,
Ich möchte in c# auf den Webservice eines TOMCAT zugreifen. Die URL ist bekannt (http://localhost:8083/SOAP/soaprouter)
es kommt eine Meldung "Sorry, I don't speak via HTTP GET- you have to use HTTP POST to talk to me."
Dies ist klar.
wie kann ich in c# diesen service ansprechen? brauche ich einen Proxy?

in LUA funktioniert der Aufruf folgendermaßen

Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
function postrq(url, rqfile)
    local rsp, errortxt
    xmlhttp:open("POST",url, false)
    xmlhttp:setRequestHeader("Content-Type","text/xml")
    luacom.config.last_error = nil
    xmlhttp:send(io.open(rqfile, "r"):read("*all"))
    errortxt = luacom.config.last_error
    return xmlhttp.responseXML.xml, errortxt
end


vielen Dank schon mal


Christian S. - Sa 29.09.07 16:40

Das sollte eigentlich über die HttpRequest-Klasse gehen. Falls ich Dein Problem richtig verstanden habe ;-)


sharpx - So 04.01.09 15:12

Warum nimmst du nicht einfach ein Socket verbindet dich damit auf Port 8080 zu dem Server.
I.d.r sowas wie:

POST /path/datei.php HTTP/1.1
Host: yourhost
...
...