este es mi código:

from suds import client
url = "
http://commonservices.min1.dtc/SearchPersonService/SearchPersonWCFService.svc?wsdl
 
<http://www.google.com/url?q=http%3A%2F%2Fcommonservices.min1.dtc%2FSearchPersonService%2FSearchPersonWCFService.svc%3Fwsdl&sa=D&sntz=1&usg=AFQjCNF4mk2ohMrAsTsLZyCUgDGDdEQg4A>
"
cliente = client.Client(url)
print (cliente)




y me sale esto:

Suds ( https://github.com/cackharot/suds-py3 
<https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fcackharot%2Fsuds-py3&sa=D&sntz=1&usg=AFQjCNEqILksXS4x8yXEI5Pg_WvBO376tQ>
 
)  version: 1.3.3.0 IN  build: 20170311

Service ( SearchPersonWCFService ) tns="http://CommonServices 
<http://www.google.com/url?q=http%3A%2F%2FCommonServices&sa=D&sntz=1&usg=AFQjCNEp5rowiLKLOG6xuoMfeq73CMDJAg>
"
   Prefixes (9)
      ns0 = "http://CommonServices 
<http://www.google.com/url?q=http%3A%2F%2FCommonServices&sa=D&sntz=1&usg=AFQjCNEp5rowiLKLOG6xuoMfeq73CMDJAg>
"
      ns1 = "
http://schemas.datacontract.org/2004/07/CommonEntities.AddressManager 
<http://www.google.com/url?q=http%3A%2F%2Fschemas.datacontract.org%2F2004%2F07%2FCommonEntities.AddressManager&sa=D&sntz=1&usg=AFQjCNFuIkgKIDsSWaQpBDgMsMyms9lOjA>
"
      ns2 = "
http://schemas.datacontract.org/2004/07/CommonEntities.DocumentsFile 
<http://www.google.com/url?q=http%3A%2F%2Fschemas.datacontract.org%2F2004%2F07%2FCommonEntities.DocumentsFile&sa=D&sntz=1&usg=AFQjCNHS6jPTW64bUFOz2T8GN3UniJmCDg>
"
      ns3 = "http://schemas.datacontract.org/2004/07/CommonEntities.Image 
<http://www.google.com/url?q=http%3A%2F%2Fschemas.datacontract.org%2F2004%2F07%2FCommonEntities.Image&sa=D&sntz=1&usg=AFQjCNEuWh1F8Cfk5v7GAHe6x5QOZ9z3sg>
"
      ns4 = "http://schemas.datacontract.org/2004/07/CommonEntities.Info 
<http://www.google.com/url?q=http%3A%2F%2Fschemas.datacontract.org%2F2004%2F07%2FCommonEntities.Info&sa=D&sntz=1&usg=AFQjCNEZl1WmU2IL7BfcKgRrEGG2vC1dYQ>
"
      ns5 = "
http://schemas.datacontract.org/2004/07/CommonEntities.PersonFile 
<http://www.google.com/url?q=http%3A%2F%2Fschemas.datacontract.org%2F2004%2F07%2FCommonEntities.PersonFile&sa=D&sntz=1&usg=AFQjCNFr-yJiATtsH7KeCdDcfc463avSEw>
"
      ns6 = "
http://schemas.datacontract.org/2004/07/CommonServices.SearchPersonService.Entities
 
<http://www.google.com/url?q=http%3A%2F%2Fschemas.datacontract.org%2F2004%2F07%2FCommonServices.SearchPersonService.Entities&sa=D&sntz=1&usg=AFQjCNGGD6kyRQZDdFskXmQ-0NgpGcJFVg>
"
      ns7 = "http://schemas.microsoft.com/2003/10/Serialization/ 
<http://www.google.com/url?q=http%3A%2F%2Fschemas.microsoft.com%2F2003%2F10%2FSerialization%2F&sa=D&sntz=1&usg=AFQjCNEHWQZgh_qwcrpQPb0fCRvkidMPaA>
"
      ns8 = "http://schemas.microsoft.com/Message 
<http://www.google.com/url?q=http%3A%2F%2Fschemas.microsoft.com%2FMessage&sa=D&sntz=1&usg=AFQjCNHhBx3XrerNYdoM47DQWXKxFFLOEw>
"
   Ports (1):
      (BasicEndPoint)
         Methods (22):
            SearchBasicForeignPersonByID(ns7:guid personId, )
            SearchBasicNationaPersonByID(ns7:guid personId, )
            SearchBasicNoRegisterPersonByID(ns7:guid personId, )
            SearchForeignPerson(ns6:SimilarForeignPerson 
similarForeignPerson, )
            SearchForeignPersonById(ns7:guid foreignPersonId, )
            SearchForeignPersonByIdentityDocument(ns6:IdentityDocument 
similarIdentityDocument, )
            
SearchForeignPersonByIdentityDocumentWhitParam(ns6:SimilarForeignPerson 
similarForeignPerson, ns6:IdentityDocument similarIdentityDocument, )
            SearchForeignPersonByIdentityNumber(xs:string identityNumber, )
            SearchGoogle(xs:string information, )
            SearchNationalAndNonRegisterPerson(ns6:SimilarNationalPerson 
similarNationalPerson, )
            
SearchNationalAndNonRegisterPersonByPhonetic(ns6:SimilarNationalPerson 
phoneticData, )
            SearchNationalPerson(ns6:SimilarNationalPerson 
similarNationalPerson, xs:boolean phonectic, )
            SearchNationalPersonByAddress(ns6:SimilarNationalPerson 
similarNationalPerson, ns1:Address place, )
            SearchNationalPersonByAddressId(ns7:guid addressId, )
            SearchNationalPersonById(ns7:guid nationalPersonId, )
            SearchNationalPersonByIdentityNumber(xs:string identityNumber, )
            SearchNationalPersonByPhonectic(xs:string identityNumber, 
xs:string firstName, xs:string secondName, xs:string firstSurname, 
xs:string secondSurname, )
            SearchNonRegisterPerson(ns6:SimilarNonRegisterPerson 
similarNonRegisterPerson, xs:boolean phonetic, )
            SearchNonRegisterPersonById(ns7:guid foreignPersonId, )
            SearchNonRegisterPersonByIdentityNumber(xs:string 
identityNumber, )
            SearchNonRegisterPersonByPhonectic(xs:string identityNumber, 
xs:string firstName, xs:string secondName, xs:string firstSurname, 
xs:string secondSurname, xs:string primaryId, xs:string secondId, )
            SearchPersonById(ns7:guid personId, )
         Types (80):
            ns1:Address
            ns1:AddressType
            ns6:ArrayOfDPERSONADIRECCION
            ns2:ArrayOfDocument
            ns2:ArrayOfDocumentDates
            ns5:ArrayOfIdentityDocument
            ns5:ArrayOfIncapability
            ns3:ArrayOfPersonImage
            ns6:ArrayOfPersonSummary
            ns2:AttributeDataType
            ns6:BasicForeignPerson
            ns6:BasicNationalPerson
            ns6:BasicNoRegisterPerson
            ns6:BasicPerson
            ns5:BiometricId
            ns4:Charge
            ns5:CivilRegister
            ns5:Country
            ns5:CulturalLevel
            ns6:DDIRECCION
            ns6:DDIRECCIONEXTRANJERO
            ns6:DFONETICAEXTRANJERO
            ns6:DINMUEBLE
            ns6:DPERSONADIRECCION
            ns6:DPERSONAIMAGEN
            ns6:Date
            ns2:Document
            ns2:DocumentDates
            ns2:DocumentType
            ns6:ExtendedPropertiesDictionary
            ns5:EyeColor
            ns3:FaceExpression
            ns3:FacialImageType
            ns3:FacialInformation
            ns5:ForeignPerson
            ns5:HearColor
            ns6:IdentityDocument
            ns5:IdentityDocument
            ns5:IdentityDocumentType
            ns3:ImageExtension
            ns3:ImageInformation
            ns3:ImageType
            ns3:ImageValidation
            ns5:Incapability
            ns5:IncapabilityType
            ns5:Job
            ns5:MaritalStatus
            ns5:MigrationClassification
            ns5:MigrationCondition
            ns5:MilitaryPerson
            ns4:MilitaryRank
            ns1:Municipality
            ns5:NationalPerson
            ns5:NonRegisterPerson
            ns5:NonRegisterReason
            ns5:OACICountryCode
            ns6:ObjectChangeTracker
            ns6:ObjectList
            ns6:ObjectState
            ns6:ObjectsAddedToCollectionProperties
            ns6:ObjectsRemovedFromCollectionProperties
            ns5:OptionalDate
            ns6:OriginalValuesDictionary
            ns5:Person
            ns3:PersonImage
            ns6:PersonSummary
            ns5:PersonType
            ns6:Place
            ns5:Profession
            ns1:Province
            ns6:SimilarForeignPerson
            ns6:SimilarNationalPerson
            ns6:SimilarNonRegisterPerson
            ns6:SimilarPerson
            ns5:SkinColor
            ns8:StreamBody
            ns5:TypeMigrationClassification
            ns7:char
            ns7:duration
            ns7:guid


lo que significa que es correcta la URL del servicio.  Ahi me los 
identifica. Entonces pruebo ejecutar un método de esos:

from suds import client
url = "
http://commonservices.min1.dtc/SearchPersonService/SearchPersonWCFService.svc?wsdl
 
<http://www.google.com/url?q=http%3A%2F%2Fcommonservices.min1.dtc%2FSearchPersonService%2FSearchPersonWCFService.svc%3Fwsdl&sa=D&sntz=1&usg=AFQjCNF4mk2ohMrAsTsLZyCUgDGDdEQg4A>
"
cliente = client.Client(url).service.
SearchNationalPersonByIdentityNumber('91041940969')
print (cliente)

y BOOOM!!!!, me da este error:


"C:\Program Files\Python35\python.exe" D:/MenoresP27/index.py
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/ 
<http://www.google.com/url?q=http%3A%2F%2Fschemas.xmlsoap.org%2Fsoap%2Fenvelope%2F&sa=D&sntz=1&usg=AFQjCNGNF5DdaQ9wHKRy5fjl5UBgSE9-HA>"
 
xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/ 
<http://www.google.com/url?q=http%3A%2F%2Fschemas.xmlsoap.org%2Fsoap%2Fenvelope%2F&sa=D&sntz=1&usg=AFQjCNGNF5DdaQ9wHKRy5fjl5UBgSE9-HA>"
 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 
<http://www.google.com/url?q=http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance&sa=D&sntz=1&usg=AFQjCNFERp6A_kcvqihMCKJ7EHX8O14vIA>"
 
xmlns:ns1="http://CommonServices 
<http://www.google.com/url?q=http%3A%2F%2FCommonServices&sa=D&sntz=1&usg=AFQjCNEp5rowiLKLOG6xuoMfeq73CMDJAg>
">
   <SOAP-ENV:Header/>
   <ns0:Body>
      <ns1:SearchNationalPersonByIdentityNumber>
         <ns1:identityNumber>91041940969</ns1:identityNumber>
      </ns1:SearchNationalPersonByIdentityNumber>
   </ns0:Body>
</SOAP-ENV:Envelope>
Traceback (most recent call last):
  File "C:\Program 
Files\Python35\lib\site-packages\suds\transport\http.py", line 78, in send
    fp = self.u2open(u2request)
  File "C:\Program 
Files\Python35\lib\site-packages\suds\transport\http.py", line 119, in 
u2open
    return url.open(u2request, timeout=tm)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 472, in open
    response = meth(req, response)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 582, in 
http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 510, in error
    return self._call_chain(*args)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 444, in 
_call_chain
    result = func(*args)
  File "C:\Program Files\Python35\lib\urllib\request.py", line 590, in 
http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Python35\lib\site-packages\suds\client.py", line 
652, in send
    reply = transport.send(request)
  File "C:\Program 
Files\Python35\lib\site-packages\suds\transport\http.py", line 178, in send
    return HttpTransport.send(self, request)
  File "C:\Program 
Files\Python35\lib\site-packages\suds\transport\http.py", line 86, in send
    raise TransportError(e.msg, e.code, e.fp)
suds.transport.TransportError: Not Found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:/MenoresP27/index.py", line 3, in <module>
    cliente = 
client.Client(url).service.SearchNationalPersonByIdentityNumber('91041940969')
  File "C:\Program Files\Python35\lib\site-packages\suds\client.py", line 
559, in __call__
    return client.invoke(args, kwargs)
  File "C:\Program Files\Python35\lib\site-packages\suds\client.py", line 
618, in invoke
    result = self.send(soapenv)
  File "C:\Program Files\Python35\lib\site-packages\suds\client.py", line 
664, in send
    result = self.failed(binding, e)
  File "C:\Program Files\Python35\lib\site-packages\suds\client.py", line 
726, in failed
    raise Exception((status, reason))
Exception: (404, 'Not Found')

Process finished with exit code 1


Alguna idea de por qué????

-- 
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