web services - Passing BASIC authentication data into a spring ws client -
I have a web service that uses basic HTTP authentication to use the server
Web service has its own authentication username and password
WS is using the SOAP UI after setting the required parameters
I am not developing a UI client which is a web Will use spring to use the service
My question is how do I use HTTP Send the encryption that is entered by the user while opening it on the web server so that he gives me access to the website
I cite the interesting part of the configuration:
& lt; Bean id = "Web service service" class = "org.springframework.ws.client.core.WebServiceTemplate" & gt; & Lt; Constructor-arg ref = "messageFactory" /> & Lt; Property Name = "MessageSenders" & gt; & Lt; Bean square = "org.springframework.ws.transport.http.HttpComponentsMessageSender" & gt; & Lt; Property Name = "Credential" & gt; & Lt; Bean class = "org.apache.http.auth.UsernamePasswordCredentials" & gt; & Lt; Constructor-arg value = "zone: secret" /> & Lt; / Bean & gt; & Lt; / Property & gt; & Lt; / Bean & gt; & Lt; / Property & gt; & Lt; Property Name = "Default Yuri" value = "http://example.com/WebService" / & gt; & Lt; / Bean & gt;
The last version of the Spring WS I used was (1.x) a while ago, but you can do a lot to offer to the Apache Commons http Client API to use Spring WS Are there. When using the WSTemplate system, the overriding point is WSMessageSender but the above suggested method allows to do everything directly from the spring configuration.
In your scenario, you can provide documentation of user name passwords that have a callback to ask the user for credentials, or otherwise injection them.
Comments
Post a Comment