SOAP .WSDL 文件无法在 ASP.NET 中实现,但在线测试工具工作正常
SOAP .WSDL file could not be implemented in ASP.NET but online testing tools work fine
我正在尝试联系我所在大学的 SOAP 服务以获取所有学生的信息。我已收到 .wsdl 文件并尝试在 Visual Studio 2015 年实施。
我添加了一个新的服务参考,粘贴了 wsdl 文件的 url 并取消选中了 "Reuse types in in all referenced assemblies" 复选框。
我在这里研究了很多解决方案,但 none 现在可以提供帮助。我开始认为 .wsdl 文件不正确,但遗憾的是我找不到错误。
我已经删除了我大学的实际地址。
警告都是关于元素中出现的 minOccurs 和 maxOccurs。
错误 是 wsdl:binding 元素必须在 soapbind:body 元素中具有文字值。 (粗略的翻译,抱歉...)但这是我第一次使用这些文件,我不知道我应该更改什么。
以下是德语错误供参考:
Ein wsdl:binding-Element in einer Beschreibung MUSS den literal-Wert für das Verwendungsattribut in allen soapbind:body-, soapbind:fault-, soapbind:header- und soapbind:headerfault-Elementen verwenden.
- Das soapbind:body-Eingabeelement des getStudentFromUid-Vorgangs in portType-Objekt 'ConfigBinding' von Namespace '[URL]'.
- Das soapbind:body-Ausgabeelement des getStudentFromUid-Vorgangs für das portType-Objekt 'ConfigBinding' von Namespace '[URL]'.
- Das soapbind:body-Eingabeelement des getStudentFromMatrikelnummer-Vorgangs in portType-Objekt 'ConfigBinding' von Namespace '[URL]'.
- Das soapbind:body-Ausgabeelement des getStudentFromMatrikelnummer-Vorgangs für das portType-Objekt 'ConfigBinding' von Namespace '[URL]'.
- Das soapbind:body-Eingabeelement des getStudentFromStudiengang-Vorgangs in portType-Objekt 'ConfigBinding' von Namespace '[URL]'.
- Das soapbind:body-Ausgabeelement des getStudentFromStudiengang-Vorgangs für das portType-Objekt 'ConfigBinding' von Namespace '[URL]'.
<?xml version='1.0' encoding='utf-8' ?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://[URL]" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://[URL]"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:message name="GetStudentFromUidRequest">
<wsdl:part minOccurs="0" maxOccurs="1" name="student_uid" type="s:string" />
<wsdl:part minOccurs="0" maxOccurs="1" name="authentifizierung" type="tns:GetAuthentifizierung" />
</wsdl:message>
<wsdl:message name="GetStudentFromUidResponse">
<wsdl:part minOccurs="0" maxOccurs="1" name="GetStudentFromUid" type="tns:Student" />
</wsdl:message>
<wsdl:message name="GetStudentFromMatrikelnummerRequest">
<wsdl:part minOccurs="0" maxOccurs="1" name="student_uid" type="s:string" />
<wsdl:part minOccurs="0" maxOccurs="1" name="authentifizierung" type="tns:GetAuthentifizierung" />
</wsdl:message>
<wsdl:message name="GetStudentFromMatrikelnummerResponse">
<wsdl:part minOccurs="0" maxOccurs="1" name="GetStudentFromUid" type="tns:Student" />
</wsdl:message>
<wsdl:message name="GetStudentFromStudiengangRequest">
<wsdl:part minOccurs="0" maxOccurs="1" name="studiengang" type="s:string" />
<wsdl:part minOccurs="0" maxOccurs="1" name="semester" type="s:string" />
<wsdl:part minOccurs="0" maxOccurs="1" name="verband" type="s:string" />
<wsdl:part minOccurs="0" maxOccurs="1" name="gruppe" type="s:string" />
<wsdl:part minOccurs="0" maxOccurs="1" name="authentifizierung" type="tns:GetAuthentifizierung" />
</wsdl:message>
<wsdl:message name="GetStudentFromStudiengangResponse">
<wsdl:part minOccurs="0" maxOccurs="1" name="GetStudentFromStudiengang" type="tns:ArrayOfStudentItem" />
</wsdl:message>
<s:complexType name="ArrayOfStudentItem">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="StudentItem" nillable="true" type="tns:Student" />
</s:sequence>
</s:complexType>
<s:complexType name="Student">
<s:element minOccurs="0" maxOccurs="1" name="studiengang_kz" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="person_id" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="semester" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="verband" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="gruppe" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="vorname" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="nachname" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="uid" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="status" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="personenkennzeichen" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="email" type="s:string" />
</s:complexType>
<s:complexType name="GetAuthentifizierung">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="username" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="passwort" type="s:string" />
</s:sequence>
</s:complexType>
<wsdl:portType name="ConfigPortType">
<wsdl:operation name="getStudentFromUid">
<wsdl:input message="tns:GetStudentFromUidRequest" />
<wsdl:output message="tns:GetStudentFromUidResponse" />
</wsdl:operation>
<wsdl:operation name="getStudentFromMatrikelnummer">
<wsdl:input message="tns:GetStudentFromMatrikelnummerRequest" />
<wsdl:output message="tns:GetStudentFromMatrikelnummerResponse" />
</wsdl:operation>
<wsdl:operation name="getStudentFromStudiengang">
<wsdl:input message="tns:GetStudentFromStudiengangRequest" />
<wsdl:output message="tns:GetStudentFromStudiengangResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ConfigBinding" type="tns:ConfigPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="getStudentFromUid">
<soap:operation soapAction="https://cis.[URL]/soap/getStudentFromUid" />
<wsdl:input>
<soap:body use="encoded" namespace="http://[URL]" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="http://[URL]" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getStudentFromMatrikelnummer">
<soap:operation soapAction="https://cis.[URL]/soap/getStudentFromMatrikelnummer" />
<wsdl:input>
<soap:body use="encoded" namespace="http://[URL]" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="http://[URL]" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getStudentFromStudiengang">
<soap:operation soapAction="https://cis.[URL]/soap/getStudentFromStudiengang" />
<wsdl:input>
<soap:body use="encoded" namespace="http://[URL]" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="http://[URL]" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Student">
<wsdl:port name="ConfigWebservicePort" binding="tns:ConfigBinding">
<soap:address location="https://cis.[URL]//soap/student.soap.php?0.12187700 1480588994" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
如果能帮助我完成我应该做的事情,我将不胜感激...
所以我尝试了一些东西,结果是 wsdl 文件与 php soap 服务不兼容。
我们大学只用 php 工具测试了 soap 客户端,并告诉我没有 ASP.NET 测试。
我不得不重写整个 .wsdl 以使其与 Visual Studio 的 "Add Service Reference..." 功能兼容。
在那之后它现在似乎可以工作了。
我正在尝试联系我所在大学的 SOAP 服务以获取所有学生的信息。我已收到 .wsdl 文件并尝试在 Visual Studio 2015 年实施。
我添加了一个新的服务参考,粘贴了 wsdl 文件的 url 并取消选中了 "Reuse types in in all referenced assemblies" 复选框。
我在这里研究了很多解决方案,但 none 现在可以提供帮助。我开始认为 .wsdl 文件不正确,但遗憾的是我找不到错误。
我已经删除了我大学的实际地址。
警告都是关于元素中出现的 minOccurs 和 maxOccurs。
错误 是 wsdl:binding 元素必须在 soapbind:body 元素中具有文字值。 (粗略的翻译,抱歉...)但这是我第一次使用这些文件,我不知道我应该更改什么。
以下是德语错误供参考:
Ein wsdl:binding-Element in einer Beschreibung MUSS den literal-Wert für das Verwendungsattribut in allen soapbind:body-, soapbind:fault-, soapbind:header- und soapbind:headerfault-Elementen verwenden.
- Das soapbind:body-Eingabeelement des getStudentFromUid-Vorgangs in portType-Objekt 'ConfigBinding' von Namespace '[URL]'.
- Das soapbind:body-Ausgabeelement des getStudentFromUid-Vorgangs für das portType-Objekt 'ConfigBinding' von Namespace '[URL]'.
- Das soapbind:body-Eingabeelement des getStudentFromMatrikelnummer-Vorgangs in portType-Objekt 'ConfigBinding' von Namespace '[URL]'.
- Das soapbind:body-Ausgabeelement des getStudentFromMatrikelnummer-Vorgangs für das portType-Objekt 'ConfigBinding' von Namespace '[URL]'.
- Das soapbind:body-Eingabeelement des getStudentFromStudiengang-Vorgangs in portType-Objekt 'ConfigBinding' von Namespace '[URL]'.
- Das soapbind:body-Ausgabeelement des getStudentFromStudiengang-Vorgangs für das portType-Objekt 'ConfigBinding' von Namespace '[URL]'.
<?xml version='1.0' encoding='utf-8' ?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://[URL]" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://[URL]"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:message name="GetStudentFromUidRequest">
<wsdl:part minOccurs="0" maxOccurs="1" name="student_uid" type="s:string" />
<wsdl:part minOccurs="0" maxOccurs="1" name="authentifizierung" type="tns:GetAuthentifizierung" />
</wsdl:message>
<wsdl:message name="GetStudentFromUidResponse">
<wsdl:part minOccurs="0" maxOccurs="1" name="GetStudentFromUid" type="tns:Student" />
</wsdl:message>
<wsdl:message name="GetStudentFromMatrikelnummerRequest">
<wsdl:part minOccurs="0" maxOccurs="1" name="student_uid" type="s:string" />
<wsdl:part minOccurs="0" maxOccurs="1" name="authentifizierung" type="tns:GetAuthentifizierung" />
</wsdl:message>
<wsdl:message name="GetStudentFromMatrikelnummerResponse">
<wsdl:part minOccurs="0" maxOccurs="1" name="GetStudentFromUid" type="tns:Student" />
</wsdl:message>
<wsdl:message name="GetStudentFromStudiengangRequest">
<wsdl:part minOccurs="0" maxOccurs="1" name="studiengang" type="s:string" />
<wsdl:part minOccurs="0" maxOccurs="1" name="semester" type="s:string" />
<wsdl:part minOccurs="0" maxOccurs="1" name="verband" type="s:string" />
<wsdl:part minOccurs="0" maxOccurs="1" name="gruppe" type="s:string" />
<wsdl:part minOccurs="0" maxOccurs="1" name="authentifizierung" type="tns:GetAuthentifizierung" />
</wsdl:message>
<wsdl:message name="GetStudentFromStudiengangResponse">
<wsdl:part minOccurs="0" maxOccurs="1" name="GetStudentFromStudiengang" type="tns:ArrayOfStudentItem" />
</wsdl:message>
<s:complexType name="ArrayOfStudentItem">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="StudentItem" nillable="true" type="tns:Student" />
</s:sequence>
</s:complexType>
<s:complexType name="Student">
<s:element minOccurs="0" maxOccurs="1" name="studiengang_kz" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="person_id" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="semester" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="verband" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="gruppe" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="vorname" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="nachname" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="uid" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="status" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="personenkennzeichen" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="email" type="s:string" />
</s:complexType>
<s:complexType name="GetAuthentifizierung">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="username" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="passwort" type="s:string" />
</s:sequence>
</s:complexType>
<wsdl:portType name="ConfigPortType">
<wsdl:operation name="getStudentFromUid">
<wsdl:input message="tns:GetStudentFromUidRequest" />
<wsdl:output message="tns:GetStudentFromUidResponse" />
</wsdl:operation>
<wsdl:operation name="getStudentFromMatrikelnummer">
<wsdl:input message="tns:GetStudentFromMatrikelnummerRequest" />
<wsdl:output message="tns:GetStudentFromMatrikelnummerResponse" />
</wsdl:operation>
<wsdl:operation name="getStudentFromStudiengang">
<wsdl:input message="tns:GetStudentFromStudiengangRequest" />
<wsdl:output message="tns:GetStudentFromStudiengangResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ConfigBinding" type="tns:ConfigPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="getStudentFromUid">
<soap:operation soapAction="https://cis.[URL]/soap/getStudentFromUid" />
<wsdl:input>
<soap:body use="encoded" namespace="http://[URL]" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="http://[URL]" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getStudentFromMatrikelnummer">
<soap:operation soapAction="https://cis.[URL]/soap/getStudentFromMatrikelnummer" />
<wsdl:input>
<soap:body use="encoded" namespace="http://[URL]" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="http://[URL]" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getStudentFromStudiengang">
<soap:operation soapAction="https://cis.[URL]/soap/getStudentFromStudiengang" />
<wsdl:input>
<soap:body use="encoded" namespace="http://[URL]" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="http://[URL]" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Student">
<wsdl:port name="ConfigWebservicePort" binding="tns:ConfigBinding">
<soap:address location="https://cis.[URL]//soap/student.soap.php?0.12187700 1480588994" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
如果能帮助我完成我应该做的事情,我将不胜感激...
所以我尝试了一些东西,结果是 wsdl 文件与 php soap 服务不兼容。
我们大学只用 php 工具测试了 soap 客户端,并告诉我没有 ASP.NET 测试。
我不得不重写整个 .wsdl 以使其与 Visual Studio 的 "Add Service Reference..." 功能兼容。
在那之后它现在似乎可以工作了。