1
Ich benutze C# und ich möchte überprüfen, welche Version von SOAP eine WSDL unterstützt. Wie kann ich das finden?Überprüfen Sie programmatisch die Version von SOAP (1.1 oder 1.2 oder beide) eine WSDL-Datei unterstützt
WSDL 1.1 Datei haben folgende Namespace in es
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
WSDL 1.2-Datei in es
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
folgende Namespace haben, und wenn eine Datei sowohl Version unterstützt kann es folgende Arten von Inhalten haben in es
<wsdl:binding name="CustServiceSoap" type="tns:CustServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="GetAllCustomers">
<soap:operation soapAction="http://tempuri.org/GetAllCustomers" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetNCustomers">
<soap:operation soapAction="http://tempuri.org/GetNCustomers" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetRangeOfCustomers">
<soap:operation soapAction="http://tempuri.org/GetRangeOfCustomers" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="CustServiceSoap12" type="tns:CustServiceSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="GetAllCustomers">
<soap12:operation soapAction="http://tempuri.org/GetAllCustomers" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetNCustomers">
<soap12:operation soapAction="http://tempuri.org/GetNCustomers" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetRangeOfCustomers">
<soap12:operation soapAction="http://tempuri.org/GetRangeOfCustomers" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
Dieser Link hat einige Details http://stackoverflow.com/questions/736845/can-a-wsdl-indicate-the-soap-version-1-1-or-1-2-of-the-web -Bedienung. Suchen Sie, wie man das in WCF macht? – Gangadhar
Ich möchte eine Funktion schreiben, in der, wenn ich die URL der WSDL-Datei bereitstellt, es zurückgeben kann, ob 1.1 unterstützt wird oder 1.2 unterstützt wird oder beide unterstützt werden. Dies kann getan werden, denke ich beim Parsen der WSDL-Datei. – Abhi
Verarbeiten Sie das WSDL-Dokument mit etwas XSLT. Einfach, leichtgewichtig und wenn Sie jemals ändern müssen, was das XSLT findet (gespeichert als Vorlage), müssen Sie keine vollständige Bereitstellung durchführen. – Chris