我想消费OTRS 票务连接器.NET 应用程序中的 Web 服务。
通常,连接到 Web 服务的最简单方法是通过“添加服务引用”导入其 WSDL。不幸的是,OTRS TicketConnector 不发布 WSDL。
我找到了 TicketConnector 的自定义 WSDLhere。但是当我尝试在“添加服务引用”中使用它时,它会导致空的 Reference.cs 显示以下错误:
Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter
Error: There was a problem loading the XSD documents provided: a reference to a schema type with name 'OTRS_TicketCreate' and namespace 'http://www.otrs.org/TicketConnector/' could not be resolved because the type definition could not be found in the schema for targetNamespace 'http://www.otrs.org/TicketConnector/'. Please check the XSD documents provided and try again.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.otrs.org/TicketConnector/']/wsdl:portType[@name='GenericTicketConnector_Interface']
Cannot import wsdl:binding
Detail: There was an error importing a wsdl:portType that the wsdl:binding is dependent on.
XPath to wsdl:portType: //wsdl:definitions[@targetNamespace='http://www.otrs.org/TicketConnector/']/wsdl:portType[@name='GenericTicketConnector_Interface']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.otrs.org/TicketConnector/']/wsdl:binding[@name='GenericTicketConnector_Service']
Cannot import wsdl:port
Detail: There was an error importing a wsdl:binding that the wsdl:port is dependent on.
XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://www.otrs.org/TicketConnector/']/wsdl:binding[@name='GenericTicketConnector_Service']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.otrs.org/TicketConnector/']/wsdl:service[@name='GenericTicketConnector']/wsdl:port[@name='GenericTicketConnector_endPoint']
Custom tool error: Failed to generate code for the service reference 'ServiceReference1'. Please check other error and warning messages for details.
我尝试通过 svcutil 导入上面的 WSDL,但没有成功。
另外,我尝试通过“添加 Web 引用”导入此 WSDL,但结果相同。
所以我的问题是:如何从 .NET 应用程序使用 OTRS TicketConnector 服务?
也许您可以提供可以使用 .NET 工具成功导入的代码片段或正确的 WSDL?
另外,如果您能帮助解决我上面提到的 WSDL 错误问题,我将不胜感激。
感谢OTRS 社区论坛,我已经得到答案了。WSDLs for 票务连接器可以在GitHub.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)