Dean MacGregor
Dean MacGregor

Reputation: 18691

Zeep not recognizing all operations

When I do python -mzeep https://testingapi.ercot.com/2007-08/Nodal/eEDS/EWS/?WSDL

the operations are blank. When I pull that up in a browser I can find many things under an <operation> tag. What am I missing?

I'm not sure if this is relevant but I hate to exclude this info if it is. The site has a zip file of XSDs and WSDL files that I don't know what to do with here.

Upvotes: 5

Views: 1725

Answers (2)

Anna Geller
Anna Geller

Reputation: 1758

Did you manage to make some progress on that? I also came across this issue with ERCOT SOAP API. What I tried to solve this problem was to replace the WSDL by a local file adapted to use wsdl: prefix. Then you can use path to the local path pointing to your MOTE.wsdl file with this content:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:ns0="http://www.ercot.com/schema/2007-06/nodal/ews/message"
                  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                  xmlns:tns="http://www.ercot.com/wsdl/2007-06/nodal/ewsConcrete"
                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                  targetNamespace="http://www.ercot.com/wsdl/2007-06/nodal/ewsConcrete">
                  xmlns:wsu="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                  xmlns:wsse="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                  xmlns:ns2="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="http://schemas.xmlsoap.org/wsdl/soap12/"
                  xmlns:ns4="http://www.w3.org/2006/05/addressing/wsdl"
                  xmlns:ns3="http://schemas.xmlsoap.org/wsdl/jms/">
    <wsp:UsingPolicy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" wsdl:Required="true"
                     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"/>
    <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
        <sp:SecurityHeader MustManifestEncryption="true" MustPrepend="true"
                           xmlns:sp="http://schemas.xmlsoap.org/ws/2002/12/secext"/>
    </wsp:Policy>
    <wsp:Policy wsu:Id="SecurityTokens" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <wsp:ExactlyOne>
            <wsp:All>
                <sp:SecurityToken xmlns:_ns1="http://www.actional.com"
                                  xmlns:sp="http://schemas.xmlsoap.org/ws/2002/12/secext">
                    <sp:TokenType>_ns1:SSLClientCertificate</sp:TokenType>
                </sp:SecurityToken>
            </wsp:All>
            <wsp:All>
                <sp:SecurityToken xmlns:sp="http://schemas.xmlsoap.org/ws/2002/12/secext">
                    <sp:TokenType>sp:X509v3</sp:TokenType>
                </sp:SecurityToken>
            </wsp:All>
            <wsp:All>
                <sp:SecurityToken xmlns:_ns1="http://www.actional.com"
                                  xmlns:sp="http://schemas.xmlsoap.org/ws/2002/12/secext">
                    <sp:TokenType>_ns1:SSLClientCertificate</sp:TokenType>
                </sp:SecurityToken>
                <sp:SecurityToken xmlns:sp="http://schemas.xmlsoap.org/ws/2002/12/secext">
                    <sp:TokenType>sp:X509v3</sp:TokenType>
                </sp:SecurityToken>
            </wsp:All>
        </wsp:ExactlyOne>
    </wsp:Policy>
    <wsp:Policy wsu:Id="SignedBody" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <sp:Integrity xmlns:sp="http://schemas.xmlsoap.org/ws/2002/12/secext">
            <sp:TokenInfo>
                <sp:SecurityToken>
                    <sp:TokenType>sp:X509v3</sp:TokenType>
                </sp:SecurityToken>
            </sp:TokenInfo>
            <sp:MessageParts>wsp:GetBody(.)</sp:MessageParts>
        </sp:Integrity>
    </wsp:Policy>
    <wsp:Policy wsu:Id="Alerts_input_policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <wsp:PolicyReference URI="#SecurityTokens"/>
        <wsp:PolicyReference URI="#SignedBody"/>
    </wsp:Policy>
    <wsp:Policy wsu:Id="Alerts_output_policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <wsp:PolicyReference URI="#SignedBody"/>
    </wsp:Policy>
    <wsp:Policy wsu:Id="MarketInfo_input_policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <wsp:PolicyReference URI="#SecurityTokens"/>
        <wsp:PolicyReference URI="#SignedBody"/>
    </wsp:Policy>
    <wsp:Policy wsu:Id="MarketInfo_output_policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <wsp:PolicyReference URI="#SignedBody"/>
    </wsp:Policy>
    <wsp:Policy wsu:Id="MarketTransactions_input_policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <wsp:PolicyReference URI="#SecurityTokens"/>
        <wsp:PolicyReference URI="#SignedBody"/>
    </wsp:Policy>
    <wsp:Policy wsu:Id="MarketTransactions_output_policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <wsp:PolicyReference URI="#SignedBody"/>
    </wsp:Policy>
    <wsdl:types>
        <xs:schema targetNamespace="http://www.ercot.com/schema/2007-06/nodal/ews/message"
                   xml:lang="en"
                   xmlns:xs="http://www.w3.org/2001/XMLSchema">
            <xs:include schemaLocation="Message.xsd"/>
        </xs:schema>
    </wsdl:types>
    <wsdl:message name="EWSResponse">
        <wsdl:part name="output" element="ns0:ResponseMessage"/>
    </wsdl:message>
    <wsdl:message name="EWSFault">
        <wsdl:part name="fault" element="ns0:FaultMessage"/>
    </wsdl:message>
    <wsdl:message name="EWSRequest">
        <wsdl:part name="input" element="ns0:RequestMessage"/>
    </wsdl:message>
    <wsdl:portType name="Operations">
        <wsdl:operation name="MarketTransactions">
            <wsdl:input message="tns:EWSRequest"/>
            <wsdl:output message="tns:EWSResponse"/>
            <wsdl:fault name="fault1" message="tns:EWSFault"/>
        </wsdl:operation>
        <wsdl:operation name="Alerts">
            <wsdl:input message="tns:EWSRequest"/>
            <wsdl:output message="tns:EWSResponse"/>
            <wsdl:fault name="fault1" message="tns:EWSFault"/>
        </wsdl:operation>
        <wsdl:operation name="MarketInfo">
            <wsdl:input message="tns:EWSRequest"/>
            <wsdl:output message="tns:EWSResponse"/>
            <wsdl:fault name="fault1" message="tns:EWSFault"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="HttpEndPointBinding" type="tns:Operations">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="MarketTransactions">
            <soap:operation soapAction="/BusinessService/NodalService.serviceagent/HttpEndPoint/MarketTransactions"
                            style="document"/>
            <wsdl:input>
                <soap:body parts="input" use="literal"/>
                <wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
                                     URI="#MarketTransactions_input_policy"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body parts="output" use="literal"/>
                <wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
                                     URI="#MarketTransactions_output_policy"/>
            </wsdl:output>
            <wsdl:fault name="fault1">
                <soap:fault name="fault1" use="literal"/>
            </wsdl:fault>
        </wsdl:operation>
        <wsdl:operation name="MarketInfo">
            <soap:operation soapAction="/BusinessService/NodalService.serviceagent/HttpEndPoint/MarketInfo"
                            style="document"/>
            <wsdl:input>
                <soap:body parts="input" use="literal"/>
                <wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
                                     URI="#MarketInfo_input_policy"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body parts="output" use="literal"/>
                <wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
                                     URI="#MarketInfo_output_policy"/>
            </wsdl:output>
            <wsdl:fault name="fault1">
                <soap:fault name="fault1" use="literal"/>
            </wsdl:fault>
        </wsdl:operation>
        <wsdl:operation name="Alerts">
            <soap:operation soapAction="/BusinessService/NodalService.serviceagent/HttpEndPoint/Alerts"
                            style="document"/>
            <wsdl:input>
                <soap:body parts="input" use="literal"/>
                <wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
                                     URI="#Alerts_input_policy"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body parts="output" use="literal"/>
                <wsp:PolicyReference xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
                                     URI="#Alerts_output_policy"/>
            </wsdl:output>
            <wsdl:fault name="fault1">
                <soap:fault name="fault1" use="literal"/>
            </wsdl:fault>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="NodalService">
        <wsdl:port name="HttpEndPoint" binding="tns:HttpEndPointBinding">
            <soap:address location="https://mttlein0010.ercot.com:8090/sst/runtime.asvc/com.ercot.eip.EWSExtHTTP"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

What do you think about this solution? I had some success with that since it now recognizes all operations. But the downside is that now I'm getting into connection issues:

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='mttlein0010.ercot.com', port=8090): Max retries exceeded with url: /sst/runtime.asvc/com.ercot.eip.EWSExtHTTP (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x00000169A3E64A00>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))

Upvotes: 0

ccmorataya
ccmorataya

Reputation: 69

You can test this other WS: ip2geo

Check that with zeep it returns the Operations related to the Service. Comparing both WSDL I've saw that the tags are very different, in the working WSDL with zeep the operations start with <wsdl:operation ... meanwhile in the other WSDL are defined in a different way.

Notice that in the start of the output of python -mzeep https://testingapi.ercot.com/2007-08/Nodal/eEDS/EWS/?WSDL it shows you several warnings saying invalid xsd type or elements and other messages.

Upvotes: 0

Related Questions