从此链接中获取 TripPriceService.wsdl通过提供保存在本地文件夹中的提到的 wsdl 文件中的 wsdl,将服务引用 (ServiceReference1) 添加到 Windows 应用程序。我的问题有两个部分
1) 根据 wsdl(TripPriceServiceException),以下故障消息是有效的肥皂故障吗?
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:trip="http://trip.price.service">
<soapenv:Header/>
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:client</faultcode>
<faultstring>error</faultstring>
<detail>
<trip:TripPriceServiceException/>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
2)现在如何处理和捕捉细节标签,当响应是肥皂:错误?
Imports windowsapp1.ServiceReference1
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim obj As New ServiceReference1.TripPriceServiceFacadeClient
Dim abc As New ServiceReference1.trip
Dim a As Single
Dim d As ServiceReference1.TripPriceServiceException
a = obj.getTripPrice(abc)
End Sub
End Class
obj.getTripPrice 行调用服务。但是,如果响应是肥皂故障(TripPriceServiceException 类型),它会抛出异常吗?如何处理这种情况,我们是否需要使用ServiceReference1.TripPriceServiceException?我只是用这个wsdl来解释我现在的情况。我们需要在我们的 Web 服务客户端中处理此类故障。