在C#应用程序中使用java Web服务

时间:2017-04-14 07:35:43

标签: c# apache web-services soapui axis2

我将使用Web服务开发一个C#应用程序,但该服务是由Apache Axis2开发的,我无法处理在C#中集成添加服务引用的服务。我没有得到回复,只有格式异常。 我没有服务代码,它就像是现成的网络服务,只是提供服务参考并开始使用它。

Web服务wsdl地址是: https://pttws.ptt.gov.tr/PttBilgi/services/Sorgu?wsdl

我还尝试使用SOAP UI运行该服务,但我得到的XML响应如下:

<faultstring>The endpoint reference (EPR) for the Operation not found is /PttBilgi/services/Sorgu.SorguHttpSoap11Endpoint/ and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator.</faultstring>

原始响应如下所示,但有一些技术细节:

HTTP/1.1 500 Internal Server Error
Date: Fri, 14 Apr 2017 07:20:28 GMT
Server: gizli gizli gizli gizli
X-OPNET-Transaction-Trace: a2_5cc44d1b-0e0c-48a5-a44f-942377e9ab70
X-Powered-By: Servlet/2.5 JSP/2.1
Vary: Accept-Encoding,User-Agent
Connection: close
Transfer-Encoding: chunked
Content-Type: application/xml; charset=UTF-8

<faultstring>The endpoint reference (EPR) for the Operation not found is /PttBilgi/services/Sorgu.SorguHttpSoap11Endpoint/ and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator.</faultstring>

似乎内容类型必须是text / html才能在C#apps中使用它,但服务的内容类型是application / xml,因此它无法转换为读取和处理结果。

如何成功使用该服务,我该怎么办?

谢谢你们!

1 个答案:

答案 0 :(得分:0)

如本文http://wso2.com/library/176/

所述

如果Axis2引擎找不到邮件的服务和操作,它会立即失败,向发件人发送错误。

如果找不到服务 - &#34;服务未找到EPR是&#34; 如果找到了服务而不是操作 - &#34;操作未找到EPR,WSA操作=&#34;