简体   繁体   中英

SOAP web service behind proxy, access using python-suds

I have this strange case scenario with python suds.

I have a soap service (java) running on a local ip, say http://10.0.0.1:8080/services/

I use suds http base auth within the local network and it's working fine.

from suds.client import Client
c = Client(url, username="user", password="pass")

But I want to make it accessible from outside, so I asked the system admin : "Can you set up a external IP use reverse proxy for this soap service"

"Yes, but the company firewall doesn't allow port 8080, so your rule will be:

http://10.0.0.1:8080/services/* <-> https://example.com/services/*

Then the rule is setup but I just can't make the client to work. I tried all kinds of transport:

from suds.transport.https import WindowsHttpAuthenticated
from suds.transport.http import HttpAuthenticated
#from suds.transport.https import HttpAuthenticated
from suds.client import Client

http = HttpAuthenticated(username="jlee", password="jlee")
#https = HttpAuthenticated(username="jlee", password="jlee")
ntlm = WindowsHttpAuthenticated(username="jlee", password="jlee")
url = "https://example.com/services/SiteManager?wsdl"
c = Client(url, transport = http)

it always returns:

suds.transport.TransportError: HTTP Error 403: Forbidden ( The server denied the specified Uniform Resource Locator (URL). Contact the server administrator.  )

I tried to access the URL https://example.com/services/SiteManager?wsdl from chrome, it returns 403 too!

But if I sign in first using other routes (my server is running other http pages on tomcat), and then access the URL again the wsdl desc page shows up!

Can anybody tell me what's wrong with this? is it to do with the configuration of the reverse proxy server or the suds transport?

Thanks very much! Jackie

通过与系统管理员(负责设置反向代理)进行交谈找到了解决方案,他说MS DMZ(反向代理服务器)中有一个复选框选项,用于允许http基本身份验证。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM