0

I'm attempting to build a WCF client in C# to consume eMedNy's SOAP web services. The WSDL is here: https://service100.emedny.org:9047/MHService?wsdl

When I try running svcutil I get this error:

Warning: The following Policy Assertions were not Imported:
XPath://wsdl:definitions[@targetNamespace=http://org/emedny/mhs/]/wsdl:binding[@name='MHS']
Assertions:
<dpe:summary xmlns:dpe='http://www.datapower.com/extensions'> .. </dpe:summary>
<sp:SupportingTokens xmlns:sp='http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702'> .. </sp:SupportingTokens>

From what I've read, this has something to do with WCF's lack of support for usernameToken with digested password.

How can I proceed to overcome this and set-up the proxy and app.config?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Isaac Kleinman
  • 3,994
  • 3
  • 31
  • 35

1 Answers1

1

Save the WSDL and any referenced WSDL/schema locally on disk. (You can find referenced files by following the "import" and "include" elements.) After you save them on disk, resolve the references: for example, if import tag was to http://www.server.com/1.WSDL and you saved it on disk to 1.wsdl then change the import tag to point to local disk. Then delete all the policy tags from the WSDL (actually just one - the root policy tag and all its children). Now you should be able to add service reference from the root WSDL on local disk.

EDIT: based on your comment the issue now is not generating the proxy but configuring security. Based on your link this is a fairly complicated security configuration to set up. Try look at this link as a base binding. Then include this to make the binary token appear serialized (might need to alter InclusionMode and ReferenceStyle). It might take quite a few adjustments to get the exact format you need. At any stage use Fiddler or WCF logs to see how your request is aligned with the desired SOAP format.

Yaron Naveh
  • 23,560
  • 32
  • 103
  • 158
  • Will that give me different results from what I'm currently getting by referencing the remote URL? As it is now, I get the warnings, but `svcutil` still goes ahead and builds the proxy and `app.config`. – Isaac Kleinman Jan 20 '14 at 22:06
  • Downloading the WSDL along with its referenced schemas is giving me 6000 files and counting.. so if the end result will be the same as I have now, I'd rather not bother.. Perhaps my real question then would be how to configure the security aspects of the (proxy?) `app.config` myself since `svcutil` can't do it for me. – Isaac Kleinman Jan 20 '14 at 22:17
  • if the proxy is compiled than you are right that the question is different. It is how to configure the binding. In order to know that please ask the vendor to provide you a sample working SOAP and publish it here. – Yaron Naveh Jan 20 '14 at 23:06
  • [This](https://www.emedny.org/selfhelp/SOAP/eMedNY_Meds_History_Service_User_Guide_1.1.pdf) has a sample soap. – Isaac Kleinman Jan 20 '14 at 23:21
  • I'll go ahead and look at those links you provided for configuring the security binding and try to set that up, but is the generated proxy and client code generated by `scvutil` good as it is? – Isaac Kleinman Jan 21 '14 at 14:19
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/45727/discussion-between-isaac-kleinman-and-yaron-naveh) – Isaac Kleinman Jan 21 '14 at 16:47