Passing username and password to svcutil.exe?

久未见 提交于 2019-11-27 17:49:54

问题


We have OSB services that are currently secured with a username and a password. I get a 401 unauthorized when attempting to generate a service proxy using svcutil. I know you need to set up a svcutil.exe.config file but I cannot find any examples except for one that passes a certificate.

Dows anyone know how to send a username and password using svcutil?


回答1:


I don't think you can do that.

What you can do in this case is either connect to that address in a browser and just download and save the WSDL file to your local disk and call svcutil.exe on that local copy - or ask the publisher of that webservice to either give you an URL which doesn't require authentication, or to simply send you the relevant WSDL and possibly XSD files so you can create a client side proxy for that service.




回答2:


You can't authenticate in svcutil, but you can set up credentials in Windows for the target machine. Go to your account management page, then to your stored credentials. Add a new entry with the target hostname and credentials. After this, you can use svcutil with the URL.




回答3:


Try this. This should work with any web page requiring username and password.

svcutil http://user:password@someurl?wsdl


来源:https://stackoverflow.com/questions/2693394/passing-username-and-password-to-svcutil-exe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!