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