Hello:

2 questions -

Using the generated classes from wsdl2java, I have been attempting to insert
basic authentication before moving to also activating SSL.  I see several
mentions in the past about using the BindingProvider to set these
properties, however I am accessing the WSDL through the web service
(.asmx?WSDL).  Thus the constructors throw exceptions before I can reach the
bindingproperty part of my code.  Is there a different pattern to be
followed here when accessing external WSDLs through the generated classes?

Secondly, if I instead simply use a local WSDL to move past that, I still
have a final issue in pointing the binding at the end point and getting a
401 despite confirming the credentials:

        Srv ss = new Srv(wsdlURL, SERVICE_NAME);        // wsdlURL
temporarily pointing at \temp\test.wsdl
        SrvSoap port = ss.getSrvSoap();
        BindingProvider portBP = (BindingProvider)port;

portBP.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "
http://mywebservice.com:5600/srv.asmx";);
        portBP.getRequestContext().put(portBP.USERNAME_PROPERTY,
"test_user");
        portBP.getRequestContext().put(portBP.PASSWORD_PROPERTY, "test_pw");

I suspect I have some mis-use going on here.  I have also read a wiki that
this may be an old pattern and one should simply use http-conduits either
through cxf.xml or dynamically (
https://cwiki.apache.org/CXF20DOC/client-http-transport-including-ssl-support.html).
In this case I still suffer the same problem as in my first question of
course.

Thanks in advance,
Jeff

Reply via email to