0

所以 - 我的任务是为以下服务创建一个代理客户端,但是我花了很长时间来生成一个对要求感到满意的客户端。WSDL 位于此处:https ://ws.conf.ebs.health.gov.on.ca:1441/EDTService/EDTService?wsdl

当我运行 svcutil 时,我得到以下输出:

C:\Temp>"C:\Program Files (x86)\Microsof
t SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\svcutil.exe" /t:code https://ws.conf.
ebs.health.gov.on.ca:1441/EDTService/EDTService?wsdl /out:ebs.cs /config:ebs.con
fig
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.32559]
Copyright (c) Microsoft Corporation.  All rights reserved.

Attempting to download metadata from 'https://ws.conf.ebs.health.gov.on.ca:1441/
EDTService/EDTService?wsdl' using WS-Metadata Exchange or DISCO.
Warning: The policy expression was not fully imported because its normalized for
m was too large.
XPath:"XPath Unavailable"

Error: Cannot import wsdl:binding
Detail: Object reference not set to an instance of an object.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://edt.health.on
tario.ca/']/wsdl:binding[@name='EDTPortBinding']

Error: Cannot import wsdl:port
Detail: There was an error importing a wsdl:binding that the wsdl:port is depend
ent on.
XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://edt.health.on
tario.ca/']/wsdl:binding[@name='EDTPortBinding']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://edt.health.on
tario.ca/']/wsdl:service[@name='EDTService']/wsdl:port[@name='EDTPort']

Error: Cannot import wsdl:port
Detail: There was an error importing a wsdl:binding that the wsdl:port is depend
ent on.
XPath to wsdl:binding: //wsdl:definitions[@targetNamespace='http://edt.health.on
tario.ca/']/wsdl:binding[@name='EDTPortBinding']
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://edt.health.on
tario.ca/']/wsdl:service[@name='EDTService']/wsdl:port[@name='EDTPort.2']

我尝试使用以下版本执行相同的命令:3.0.4506.2152、4.0.30319.18020 和 4.0.30319.32559,结果相同。有任何想法吗?

我在某些时候使用 WSDL.exe(从 Microsoft.Web.Services3.WebServicesClientProtocol 继承)创建了一个代理,但是我必须自己配置所有内容,并且每次收到响应时都会遇到异常(捕获异常,手动解密响应正文并重复)。此外,我必须使用 MTOM,这使得这个自定义代码的工作量更少。

4

0 回答 0