Zeep opens a connection, and then nothing else happens. Except the eventual timeout

Viewed 31

I'm at a loss at what is happening here. I'm new to using Zeep (suddenly had to implement SOAP requests, and the request library isn't as tuned for this as Zeep...).

I was able to get the tutorials to run just fine. But when I went to program the actual task I need, BRICK WALL.

At the point wherein you declare your client/WSDL the script stops moving forward and eventually times out. What's stranger is that it will, every so often move on to the next step. But because 95% of the time it freezes, I have yet to get it to work.

Here is the WSDL: http://sprws.sprich.com/sprws/StockCheck.php.20130201?wsdl

Here is the -mzeep :

Prefixes:
     xsd: http://www.w3.org/2001/XMLSchema
     ns0: http://sprws.sprich.com/sprws/StockCheck.php?wsdl
     ns1: http://schemas.xmlsoap.org/soap/encoding/

Global elements:
     ns1:Array(ns1:Array)
     ns1:ENTITIES(ns1:ENTITIES)
     ns1:ENTITY(ns1:ENTITY)
     ns1:ID(ns1:ID)
     ns1:IDREF(ns1:IDREF)
     ns1:IDREFS(ns1:IDREFS)
     ns1:NCName(ns1:NCName)
     ns1:NMTOKEN(ns1:NMTOKEN)
     ns1:NMTOKENS(ns1:NMTOKENS)
     ns1:NOTATION(ns1:NOTATION)
     ns1:Name(ns1:Name)
     ns1:QName(ns1:QName)
     ns1:Struct(ns1:Struct)
     ns1:anyType(xsd:anyType)
     ns1:anyURI(ns1:anyURI)
     ns1:base64Binary(ns1:base64Binary)
     ns1:boolean(ns1:boolean)
     ns1:byte(ns1:byte)
     ns1:date(ns1:date)
     ns1:dateTime(ns1:dateTime)
     ns1:decimal(ns1:decimal)
     ns1:double(ns1:double)
     ns1:duration(ns1:duration)
     ns1:float(ns1:float)
     ns1:gDay(ns1:gDay)
     ns1:gMonth(ns1:gMonth)
     ns1:gMonthDay(ns1:gMonthDay)
     ns1:gYear(ns1:gYear)
     ns1:gYearMonth(ns1:gYearMonth)
     ns1:hexBinary(ns1:hexBinary)
     ns1:int(ns1:int)
     ns1:integer(ns1:integer)
     ns1:language(ns1:language)
     ns1:long(ns1:long)
     ns1:negativeInteger(ns1:negativeInteger)
     ns1:nonNegativeInteger(ns1:nonNegativeInteger)
     ns1:nonPositiveInteger(ns1:nonPositiveInteger)
     ns1:normalizedString(ns1:normalizedString)
     ns1:positiveInteger(ns1:positiveInteger)
     ns1:short(ns1:short)
     ns1:string(ns1:string)
     ns1:time(ns1:time)
     ns1:token(ns1:token)
     ns1:unsignedByte(ns1:unsignedByte)
     ns1:unsignedInt(ns1:unsignedInt)
     ns1:unsignedLong(ns1:unsignedLong)
     ns1:unsignedShort(ns1:unsignedShort)


Global types:
     xsd:anyType
     ns1:Array(_value_1: ANY[], arrayType: xsd:string, offset: ns1:arrayCoordinate, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:ENTITIES(xsd:ENTITIES, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:ENTITY(xsd:ENTITY, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:ID(xsd:ID, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:IDREF(xsd:IDREF, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:IDREFS(xsd:IDREFS, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:NCName(xsd:NCName, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:NMTOKEN(xsd:NMTOKEN, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:NMTOKENS(xsd:NMTOKENS, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:NOTATION(xsd:QName, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:Name(xsd:Name, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:QName(xsd:QName, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:Struct(_value_1: ANY[], id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:anyURI(xsd:anyURI, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:arrayCoordinate
     ns1:base64
     ns1:base64Binary(xsd:base64Binary, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:boolean(xsd:boolean, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:byte(xsd:byte, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:date(xsd:date, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:dateTime(xsd:dateTime, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:decimal(xsd:decimal, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:double(xsd:double, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:duration(xsd:duration, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:float(xsd:float, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:gDay(xsd:gDay, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:gMonth(xsd:gMonth, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:gMonthDay(xsd:gMonthDay, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:gYear(xsd:gYear, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:gYearMonth(xsd:gYearMonth, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:hexBinary(xsd:hexBinary, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:int(xsd:int, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:integer(xsd:integer, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:language(xsd:language, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:long(xsd:long, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:negativeInteger(xsd:negativeInteger, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:nonNegativeInteger(xsd:nonNegativeInteger, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:nonPositiveInteger(xsd:nonPositiveInteger, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:normalizedString(xsd:normalizedString, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:positiveInteger(xsd:positiveInteger, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:short(xsd:short, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:string(xsd:string, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:time(xsd:time, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:token(xsd:token, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:unsignedByte(xsd:unsignedByte, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:unsignedInt(xsd:unsignedInt, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:unsignedLong(xsd:unsignedLong, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns1:unsignedShort(xsd:unsignedShort, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns0:ArrayOfStockCheckRow(_value_1: StockCheckRow[], arrayType: xsd:string, offset: ns1:arrayCoordinate, id: xsd:ID, href: xsd:anyURI, _attr_1: {})
     ns0:StockCheckInputs(GroupCode: xsd:string, UserID: xsd:string, Password: xsd:string, Action: xsd:string, CustNumber: xsd:string, DcNumber: xsd:string, ItemNumber: xsd:string, SortBy: xsd:string, MinInFullPacks: xsd:string, Availa
bleOnly: xsd:string)
     ns0:StockCheckResults(ErrorMessage: xsd:string, RtnStatus: xsd:string, RtnMessage: xsd:string, SprItemNum: xsd:string, StripNumber: xsd:string, UpcNumber: xsd:string, OldNumber: xsd:string, ItemStatus: xsd:string, ProductClass: xs
d:string, Description: xsd:string, SellUom: xsd:string, CatalogPage: xsd:string, MatrixPage: xsd:string, ItemWeight: xsd:string, ItemCubes: xsd:string, BrokenQtyAllowed: xsd:string, InfoProcessing: xsd:string, ReadyAssemble: xsd:string
, Furniture: xsd:string, DatedGoods: xsd:string, CountryOfOrigin: xsd:string, ServiceSupply: xsd:string, NoReturn: xsd:string, SpecialOrder: xsd:string, UpsShippable: xsd:string, HazmatMessage: xsd:string, RetailPrice: xsd:string, Reta
ilUom: xsd:string, MatrixPrice: xsd:string, MatrixUom: xsd:string, CurrencyCode: xsd:string, OrderMinimum: xsd:string, UpchargeMessage: xsd:string, ResultsRows: ns0:ArrayOfStockCheckRow)
     ns0:StockCheckRow(DcNum: xsd:string, DcName: xsd:string, Available: xsd:string, Uom: xsd:string, OnOrder: xsd:string, Expected: xsd:string, Sprinter: xsd:string, CutOff: xsd:string, LeadTime: xsd:string, DcType: xsd:string)       
     xsd:ENTITIES
     xsd:ENTITY
     xsd:ID
     xsd:IDREF
     xsd:IDREFS
     xsd:NCName
     xsd:NMTOKEN
     xsd:NMTOKENS
     xsd:NOTATION
     xsd:Name
     xsd:QName
     xsd:unsignedByte
     xsd:unsignedInt
     xsd:unsignedLong
     xsd:unsignedShort

Bindings:
     Soap11Binding: {http://sprws.sprich.com/sprws/StockCheck.php?wsdl}StockCheckBinding

Service: StockCheck
     Port: StockCheckPort (Soap11Binding: {http://sprws.sprich.com/sprws/StockCheck.php?wsdl}StockCheckBinding)
         Operations:
            StockCheck(input: ns0:StockCheckInputs) -> return: ns0:StockCheckResults

Here is a photo of this working using SoapUI: Soap UI result

And here is the code I have:

from zeep import Client
from zeep import xsd

print('A')
client = Client(wsdl='http://sprws.sprich.com/sprws/StockCheck.php.20130201?wsdl')

print('B')
randomtype = client.get_type('ns0:StockCheckInputs')

print('C')
print(randomtype)

print('D')
StockCheckInputs = randomtype( GroupCode='[removed]', UserID='[removed]', Password='[removed]', ItemNumber='HAM105007CT', Action='F', SortBy='A', AvailableOnly='Y', CustNumber='')

print("E")
result = client.service.StockCheck(StockCheckInputs)

print("F")
print(result)

The authentication is sent in the SOAP envelope. And there are 3-parts to the authentication: group, id, pass.

I just attempted to rerun this code and got errors at line 1 about import not working. So, now I can't even share the error I was getting.

Has anyone experienced this problem before?

FYI, via requests this works just fine.

0 Answers
Related