From: Bernd P. <be...@pr...> - 2007-09-20 13:09:42
|
It's an intranet server, that's why you can't reach it. Yes, the address is correct. No, I don't need authentication. -- Bernd On Wed, 19 Sep 2007 23:03:24 -0700, drj <dr....@pl...> wrote: > If i try to run your script and switch > 'httplib.HTTPConnection.debuglevel = 1' on, connect to the server > fails. > Is the address correct? > Do you need authentication? > > Jürgen Krampert > > On 19 Sep., 22:40, Bernd Prager <be...@prager.ws> wrote: >> Maybe you can help me to figure this out? >> >> The following python script does exactly what I want and works like a >> charm. >> >> I still don't know which part of the ZSI version I got wrong. And I > would >> love to do that in ZSI! >> --------- snip --------------- >> #!/usr/bin/python >> import sys, httplib >> >> SM_TEMPLATE = """<SOAP-ENV:Envelope >> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body/></SOAP-ENV:Envelope>""" >> >> SoapMessage = SM_TEMPLATE >> >> webservice = httplib.HTTP("172.16.59.60:1026") > >> >> webservice.putrequest("POST", "//www.qas.com/web-2005-02/DoGetData") > >> >> webservice.putheader("Host", "172.16.59.60:1026") > >> >> webservice.putheader("User-Agent", "Python post") > >> >> webservice.putheader("Content-type", "text/xml; charset=\"UTF-8\"") > >> >> webservice.putheader("Content-length", "%d" % len(SoapMessage)) > >> >> webservice.putheader("SOAPAction", >> "\"http://www.qas.com/web-2005-02/DoGetData\"") > >> >> webservice.endheaders() > >> >> webservice.send(SoapMessage) >> statuscode, statusmessage, header = webservice.getreply() >> print "Response: ", statuscode, statusmessage >> print "headers: ", header >> >> res = webservice.getfile().read() >> print res >> --------- snip --------------- >> >> On Wed, 19 Sep 2007 12:20:08 -0700, Joshua Boverhof <jrbover...@lbl.gov> >> wrote: >> >> >> >> > I think this is the http server telling you the resource doesn't >> > exist, or it can't find what you're looking for. Most likely this is >> > a path issue, it is not the root resource you're looking for. >> >> > -josh >> >> > On Sep 17, 2007, at 12:29 PM, Bernd Prager wrote: >> >> >> I am trying to access a simple web service with ZSI. >> >> I checked the service with XMLSpy and it works with a "connection >> >> endpoint":http://172.16.59.60:1026/and a "SOAPAction" string: >> >>http://www.qas.com/web-2005-02/DoGetData. >> >> >> When I try to use this in ZSI with following code: >> >> >> ---- snip ------------------- >> >> import sys >> >> >> #Import the ZSI client >> >> from ZSI.client import Binding >> >> >> u = 'http://172.16.59.60:1026/' >> >> n = 'http://www.qas.com/web-2005-02/DoGetData' >> >> >> b = Binding(url=u, ns=n, host='172.16.59.60', port=1026, >> >> tracefile=sys.stdout) >> >> >> result = b.DoGetData() >> >> >> print result >> >> ---- snip ------------------- >> >> >> I get the trace: >> >> ---- snip ------------------- >> >> _________________________________ Mon Sep 17 15:23:06 2007 REQUEST: >> >> <SOAP-ENV:Envelope >> >> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" >> >> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >> >> xmlns:ZSI="http://www.zolera.com/schemas/ZSI/" >> >> xmlns:xsd="http://www.w3.org/2001/XMLSchema" >> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> >> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/ >> >> encoding/"><SOAP-ENV:Header></SOAP-ENV:Header><SOAP- >> >> ENV:Body><DoGetData></DoGetData></SOAP-ENV:Body></SOAP-ENV:Envelope> >> >> _________________________________ Mon Sep 17 15:23:06 2007 RESPONSE: >> >> 404 >> >> Not Found >> >> ------- >> >> Content-Length: 0 >> >> Content-Type: text/xml >> >> >> Traceback (most recent call last): >> >> File "./qasTest.py", line 13, in <module> >> >> result = b.DoGetData() >> >> File "build/bdist.cygwin-1.5.24-i686/egg/ZSI/client.py", line 42, > in >> >> __call__ >> >> File "build/bdist.cygwin-1.5.24-i686/egg/ZSI/client.py", line >> >> 171, in RPC >> >> File "build/bdist.cygwin-1.5.24-i686/egg/ZSI/client.py", line >> >> 498, in >> >> Receive >> >> File "build/bdist.cygwin-1.5.24-i686/egg/ZSI/client.py", line >> >> 394, in >> >> ReceiveSOAP >> >> TypeError: Received empty response >> >> >> ---- snip ------------------- >> >> >> I am not sure what 404 Not Found is really telling me. >> >> Any ideas what I am doing wrong? >> >> >> Thanks for any suggestions, >> >> -- Bernd >> >> >> > ---------------------------------------------------------------------- >> >> --- >> >> This SF.net email is sponsored by: Microsoft >> >> Defy all challenges. Microsoft(R) Visual Studio 2005. >> >>http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >> >> _______________________________________________ >> >> Pywebsvcs-talk mailing list >> >> Pywebsvcs-t...@lists.sourceforge.net >> >>https://lists.sourceforge.net/lists/listinfo/pywebsvcs-talk >> >> Also archived athttp://groups.google.com/group/pywebsvcs >> >> > ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Microsoft >> Defy all challenges. Microsoft(R) Visual Studio > 2005.http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >> _______________________________________________ >> Pywebsvcs-talk mailing list >> > Pywebsvcs-t...@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/pywebsvcs-talk >> Also archived athttp://groups.google.com/group/pywebsvcs > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Pywebsvcs-talk mailing list > Pyw...@li... > https://lists.sourceforge.net/lists/listinfo/pywebsvcs-talk > Also archived at http://groups.google.com/group/pywebsvcs |