I kind of let this lay around until last night, when I had the happy idea 
that this would help me with a particular user problem.  I have stand-alone 
SOAP clients using SUDS or Java, but I have a user where installing those 
clients could be problematic.  So I tried as below, but failed.

Note that instead of doing this from a console, I was trying to make this a 
function within my controller, so that it could be used by clinking a link 
on a page I'm serving.  I have an instance of web2py on an old Fedora, 
where it has been running happily for nearly a year.  The SOAP provider 
works fine there.  In addition, there is a summary page I can browse to.  
This works from the local browser, but when I try to use the SOAP client 
code I get connection refused.  So I turned to another instance of web2py, 
running on Centos machine.  I can access it just fine via my stand-alone 
SOAP clients and the summary page, but again I get "connection refused".
(from urlib2.py, line 1165, Errno 111 per the ticket.; HTTP 500 sent to the 
client machine).

tcpdump on the Centos machine shows it being the access to the function 
that acts as the SOAP client, and console output indicates that 
instantiating the client is the problem.  I've tried with both the location 
parameters as shown below, or with the wsdl parameter as in the first 
example on pysimplesoap, and with and without setting the Authorization 
header (the servers are on an internal network, and still using Rocket, and 
so I've turned off authorization on the SOAP provider;  the stand-alone 
clients send the authorization header, but it isn't used).  One of the 
stand-alone clients uses pyssimplesoap.

Any suggestions?

Dave
/dps





On Wednesday, July 9, 2014 6:47:42 AM UTC-7, Matheus Cardoso wrote:
>
> There are some examples in the web2py's book 
> <http://web2py.com/books/default/chapter/29/10/services#SOAP> and lots of 
> more in pysimplesoap repository <https://code.google.com/p/pysimplesoap/>, 
> as Massimo said. Besides, I just created a WS and a SOAP client with basic 
> authentication and I used some of many forms of consuming a WS like this:
>
>
> ws_user = "your_login"
> ws_pass = "your_password"
>
> #I am using web2py to create the client
> from gluon.contrib.pysimplesoap.client import SoapClient
> import base64
> encoded = base64.b64encode('%s:%s' % (ws_user, ws_pass)).replace('\n', '')
>
> # The following IS NOT the address of the WSDL from WS
> ws_location = "your_web_service_location"
> ws_action = "your_web_service_action"
> ws_namespace = "your_web_service_namespace"
>
> # Create the client
> client_soap = SoapClient(
>     location = ws_location,
>     action = ws_action, # SOAPAction
>     namespace = ws_namespace,
>     soap_ns='soap', trace = False, ns = False, exceptions=True, 
> http_headers={'Authorization': "Basic %s" % encoded})
>
> Enjoy! :)
>
> On Monday, June 23, 2014 2:39:22 PM UTC-3, Gopi wrote:
>>
>> Hi All.. I am new to web2py. Is there a way to call external NetTcp SOAP 
>> service in Web2Py. What are the best practices to call such  services in 
>> Web2Py?
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to