从.net应用程序中使用OTRS TicketConnector

本文关键字:OTRS TicketConnector net 应用程序 | 更新日期: 2023-09-27 18:15:49

我想在。net应用程序中使用OTRS TicketConnector webservice。

通常,连接到web服务的最简单方法是通过"添加服务引用"导入其WSDL。不幸的是,OTRS TicketConnector没有发布WSDL。

我在这里找到了TicketConnector的自定义WSDL。但是当我试图在"添加服务引用"中使用它时,它会导致一个空的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服务?
也许您可以提供一个代码片段或适当的WSDL,可以用。net工具成功导入?
此外,如果您能帮助我解决上面提到的WSDL错误问题,我将不胜感激。

从.net应用程序中使用OTRS TicketConnector

感谢OTRS社区论坛,我得到了答案。票证连接器的wsdl 可在GitHub上获得。