4

我想在 .NET 应用程序中使用OTRS TicketConnector 网络服务。

通常,连接到 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 服务?
也许您可以提供可以使用 .NET 工具成功导入的代码片段或适当的 WSDL?
另外,如果能帮助我解决我上面提到的 WSDL 错误问题,我将不胜感激。

4

1 回答 1

3

感谢OTRS 社区论坛,我得到了答案。Ticket Connector的WSDL可在GitHub 上获得。

于 2014-07-31T21:48:46.637 回答