Ich habe das Problem, dass die von mir generierten Webservice-Client-Klassen immer null als Ergebnis zurück liefern, obwohl der String "success" erwartet wird. Die Klassen habe ich unter Java 6 mit com.sun.tools.ws.ant.WsImport unter Ant erzeugt, die wsdl schaut so aus:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://some.server.net/WebDNS" targetNamespace="http://some.server.net/WebDNS" >
<wsdl:message name="updateResponse">
<wsdlart name="updateReturn" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="updateRequest"/>
<wsdlortType name="WebDNS">
<wsdlperation name="update">
<wsdl:input message="tns:updateRequest" name="updateRequest"/>
<wsdlutput message="tns:updateResponse" name="updateResponse"/>
</wsdlperation>
</wsdlortType>
<wsdl:binding name="WebDNSSoapBinding" type="tns:WebDNS">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdlperation name="update">
<wsdlsoapperation soapAction="http://some.server.net/WebDNS#update"/>
<wsdl:input name="updateRequest">
<wsdlsoap:body namespace="http://some.server.net/WebDNS" use="literal"/>
</wsdl:input>
<wsdlutput name="updateResponse">
<wsdlsoap:body namespace="http://some.server.net/WebDNS" use="literal"/>
</wsdlutput>
</wsdlperation>
</wsdl:binding>
<wsdl:service name="WebDNSService">
<wsdlort name="WebDNS" binding="tns:WebDNSSoapBinding">
<wsdlsoap:address location="http://some.server.net/WebDNS"/>
</wsdlort>
</wsdl:service>
</wsdl:definitions>
Es werden zwei Klassen erzeugt, WebDNS und WebDNSService, die ich folgendermaßen aufrufe:
Ich habe mich auch mal in meinen Netzwerk-Traffic reingehängt und sehe dort folgendes als Rückgabe:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<updateResponse xmlns="http://some.server.net/WebDNS">
<updateReturn xsi:type="xsd:string">success</updateReturn>
</updateResponse>
</soap:Body>
</soap:Envelope>
Trotzdem bleibt der String result auf null... ???:L
Sieht irgendjemand das Problem?
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://some.server.net/WebDNS" targetNamespace="http://some.server.net/WebDNS" >
<wsdl:message name="updateResponse">
<wsdlart name="updateReturn" type="xsd:string"/>
</wsdl:message>
<wsdl:message name="updateRequest"/>
<wsdlortType name="WebDNS">
<wsdlperation name="update">
<wsdl:input message="tns:updateRequest" name="updateRequest"/>
<wsdlutput message="tns:updateResponse" name="updateResponse"/>
</wsdlperation>
</wsdlortType>
<wsdl:binding name="WebDNSSoapBinding" type="tns:WebDNS">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdlperation name="update">
<wsdlsoapperation soapAction="http://some.server.net/WebDNS#update"/>
<wsdl:input name="updateRequest">
<wsdlsoap:body namespace="http://some.server.net/WebDNS" use="literal"/>
</wsdl:input>
<wsdlutput name="updateResponse">
<wsdlsoap:body namespace="http://some.server.net/WebDNS" use="literal"/>
</wsdlutput>
</wsdlperation>
</wsdl:binding>
<wsdl:service name="WebDNSService">
<wsdlort name="WebDNS" binding="tns:WebDNSSoapBinding">
<wsdlsoap:address location="http://some.server.net/WebDNS"/>
</wsdlort>
</wsdl:service>
</wsdl:definitions>
Es werden zwei Klassen erzeugt, WebDNS und WebDNSService, die ich folgendermaßen aufrufe:
Java:
String result = new WebDNSService().getWebDNS().update();
Ich habe mich auch mal in meinen Netzwerk-Traffic reingehängt und sehe dort folgendes als Rückgabe:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<updateResponse xmlns="http://some.server.net/WebDNS">
<updateReturn xsi:type="xsd:string">success</updateReturn>
</updateResponse>
</soap:Body>
</soap:Envelope>
Trotzdem bleibt der String result auf null... ???:L
Sieht irgendjemand das Problem?