mvantellingen / python-zeep

A Python SOAP client
http://docs.python-zeep.org
Other
1.89k stars 586 forks source link

Error parsing WSDL elements #924

Open umiphos opened 5 years ago

umiphos commented 5 years ago
  1. zeep==3.2.0
  2. WSDL
  3. The screipt is in this GIST

Note: Apparently the WSDL we are consulting has 2 posible namespaces, when is checking the second one it crashes, not every time, but 9 out of 10. The other time that works is to tell us we don't have permissions to connect to that service(that's expected).

If I'm missing something pls tell me what, I tried to fix the code in the method that trigger the error, the get from wsdl/wsdl.py

I added an else, but I don't think it's the best solution.

<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap11="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp200409="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsp200607="http://www.w3.org/2006/07/ws-policy" xmlns:ns0="http://service.gem.factura.comppago.registro.servicio.sunat.gob.pe/" xmlns:ns1="http://service.sunat.gob.pe" xmlns:ns2="http://www.datapower.com/extensions/http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://www.datapower.com/extensions/http://schemas.xmlsoap.org/wsdl/soap12/">
<wsdl:binding name="BillServicePortBinding" type="ns1:billService">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="getStatus">
<soap12:operation soapAction="urn:getStatus" soapActionRequired="true" style="document"/>
<wsdl:input name="getStatusRequest">
<soap12:body use="literal"/></wsdl:input>
<wsdl:output name="getStatusResponse">
<soap12:body use="literal"/></wsdl:output></wsdl:operation>
<wsdl:operation name="sendBill">
<soap12:operation soapAction="urn:sendBill" soapActionRequired="true" style="document"/>
<wsdl:input name="sendBillRequest">
<soap12:body use="literal"/></wsdl:input>
<wsdl:output name="sendBillResponse">
<soap12:body use="literal"/></wsdl:output></wsdl:operation>
<wsdl:operation name="sendPack">
<soap12:operation soapAction="urn:sendPack" soapActionRequired="true" style="document"/>
<wsdl:input name="sendPackRequest">
<soap12:body use="literal"/></wsdl:input>
<wsdl:output name="sendPackResponse">
<soap12:body use="literal"/></wsdl:output></wsdl:operation>
<wsdl:operation name="sendSummary">
<soap12:operation soapAction="urn:sendSummary" soapActionRequired="true" style="document"/>
<wsdl:input name="sendSummaryRequest">
<soap12:body use="literal"/></wsdl:input>
<wsdl:output name="sendSummaryResponse">
<soap12:body use="literal"/></wsdl:output></wsdl:operation></wsdl:binding></wsdl:definitions>
umiphos commented 5 years ago

MR related to this issue https://github.com/mvantellingen/python-zeep/pull/926