Use java to access a WCF service with TransportWithMessageCredentials (UserName)

和自甴很熟 提交于 2020-01-05 04:31:09

问题


I have developed a WCF service that uses BasicHttpBinding with TransportWithMessageCredentials and custom username and password validation. I have a client who needs to interface with my service, but the client uses Java. Not being a Java programmer myself, I can't help him much. So I thought I would extend the question to the SO community. Can you guys shed some light here?


回答1:


I think that should not be hard. For BasicHttpBinding TransportWithMessageCredentials means that it is protected by HTTPS (so call service via HTTPS not HTTP) and authentication, that is just added to SOAP headers. To get a sample you can switch off Transport security (switch to HTTP), capture actual data passed with sniffer (like WireShark) and make Java app send data in that form.




回答2:


Try using the Java library Axis to interact with the WCF service.

I think Axis has the ability to generate Java service interaction code based on a WSDL (WSDL2Java).



来源:https://stackoverflow.com/questions/4218135/use-java-to-access-a-wcf-service-with-transportwithmessagecredentials-username

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