问题
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