WSDL: wsdl2py

Sockets, TCP/IP, (XML-)RPC und ähnliche Themen gehören in dieses Forum
Antworten
HunrigerHans
User
Beiträge: 7
Registriert: Dienstag 17. März 2009, 15:20

Hi Community,

ich habe mir folgendes Tutorial angeschaut und auch durchgearbeitet:
http://www.mutschler-net.de/18801.html

Ich habe schon eine Applikation geschrieben, die mit Hilfe von SOAPpy kommuniziert. Jetzt soll das ganze aber mit ZSI realisiert und eine WSDL geschrieben werden.
Nun bin ich dabei meine eigene WSDL zu schreiben und mit wsdl2py bzw. wsdl2dispatch die nötigen Files erstellen zu lassen. Leider gelingt mir das ganze nicht. Hier ist meine WSDL:

Code: Alles auswählen

<?xml version="1.0"?>
<definitions name="MyApplication"
        targetNamespace="https://MyNs:8080/MyApplication"
	xmlns:tns="https://MyNs:8080/MyApplication"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
	xmlns="http://schemas.xmlsoap.org/wsdl/">
	
	<message name="getNormalizeRequest">
		<part name="station" type="xsd:string"/>
	</message>
	<message name="getNormalizeResponse">
		<part name="station" type="xsd:string"/>
	</message>
	<message name="getStatusResponse">
		<part name="status" type="xsd:string"/>
	</message>
	<message name="getUnsubscribeRequest">
		<part name="station" type="xsd:string"/>
		<part name="ncs" type="xsd:string"/>
	</message>
	<message name="getMyDataResponse">
		<part name="status" type="xsd:string"/>
	</message>
	<message name="getMyDataRequest">
		<part name="station" type="xsd:string"/>
		<part name="ncs" type="xsd:string"/>
	</message>
        
	<portType name="MyApplicationPortType">
		<operation name="normalizeInfo">
			<documentation>normalizeInfo</documentation>
			<input message="tns:getNormalizeRequest"/>
			<output message="tns:getNormalizeResponse"/>
		</operation>
                <operation name="getStatus">
			<documentation>getApplicationStatus</documentation>
			<output message="tns:getStatusResponse"/>
		</operation>
		<operation name="getMyData">
			<documentation>getMyData</documentation>
			<input message="tns:getMyDataRequest"/>
			<output message="tns:getMyDataResponse"/>
		</operation>
		<operation name="unsubscribeStation">
                        <documentation>normalizeInfo</documentation>
			<input message="tns:getUnsubscribeRequest"/>
		</operation>
	</portType>
	
	<binding name="MyApplicationBinding" type="tns:MyApplicationPortType">
		<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
			<operation name="normalizeInfo">
				<soap:operation soapAction="https://localhost/MyApplication/normalizeInfo"/>
				<input><soap:body use="literal" namespace="https://127.0.0.1:8080/MyApplication"/></input>
				<output><soap:body use="literal" namespace="https://127.0.0.1:8080/MyApplication"/></output>
			</operation>
                        <operation name="getStatus">
				<soap:operation soapAction="https://localhost/MyApplication/getStatus"/>
				<input><soap:body use="literal" namespace="https://127.0.0.1:8080/MyApplication"/></input>
				<output><soap:body use="literal" namespace="https://127.0.0.1:8080/MyApplication"/></output>
			</operation>
                        <operation name="getMyData">
				<soap:operation soapAction="https://localhost/MyApplication/getMyData"/>
				<input><soap:body use="literal" namespace="https://127.0.0.1:8080/MyApplication"/></input>
				<output><soap:body use="literal" namespace="https://127.0.0.1:8080/MyApplication"/></output>
			</operation>
                        <operation name="unsubscribeStation">
				<soap:operation soapAction="https://localhost/MyApplication/unsubscribeStation"/>
				<input><soap:body use="literal" namespace="https://127.0.0.1:8080/MyApplication"/></input>
				<output><soap:body use="literal" namespace="https://127.0.0.1:8080/MyApplication"/></output>
			</operation>
	</binding>
        
	<service name="MyApplicationService">
		<port name="MyApplicationPort" binding="tns:MyApplicationBinding">
			<soap:address location="https://127.0.0.1:8080/MyApplication"/>
		</port>
	</service>
</definitions>
Wenn ich dann wsdl2py ausführe kommt es zu folgendem Fehler:
ItsMe:~/Dokumente/Application/Code/wsdl$ wsdl2py -f myWSDL.wsdl
Traceback (most recent call last):
File "/usr/bin/wsdl2py", line 9, in ?
wsdl2py()
File "/var/lib/python-support/python2.4/ZSI/generate/commands.py", line 223, in wsdl2py
wsm.writeClient(fd)
File "/var/lib/python-support/python2.4/ZSI/generate/wsdl2python.py", line 211, in writeClient
sd.fromWsdl(service, **kw)
File "/var/lib/python-support/python2.4/ZSI/generate/wsdl2python.py", line 278, in fromWsdl
sop_container.setUp(port)
File "/var/lib/python-support/python2.4/ZSI/generate/containers.py", line 736, in setUp
c.setUp(bop)
File "/var/lib/python-support/python2.4/ZSI/generate/containers.py", line 505, in setUp
self.inputName = op.getInputMessage().name
AttributeError: 'NoneType' object has no attribute 'name'
Anscheinend hängt er sich am Attribut des operation-Elements auf. In anderen Beispielen habe ich aber gesehen, dass so etwas geht. Und wenn ich nur ein <operation>-Element habe funktioniert das ganze einwandfrei...
Wenn ich in <binding><operation> die Attribute name, name1, name2 nenne dann erstellt er mir zwar Dateien, aber die sind fehlerhaft und fliegen mir spätestens bei wsdl2dispatch um die Ohren.

Was kann ich tun? wo ist mein Denkfehler? Ich seh den Wald vor lauter Bäumen nicht mehr...

Vielen Dank für die Hilfe!!!

Gruß,

der Hans, Wurst
HunrigerHans
User
Beiträge: 7
Registriert: Dienstag 17. März 2009, 15:20

keiner eine Idee? :K
Antworten