|
Hi,
I added the following code to the
DynamicInvoker.java from the samples directory:
System.out.println("Setting
context");
WSIFMessage ctx = dpf.getContext(); ctx.setObjectPart(org.apache.wsif.WSIFConstants.CONTEXT_HTTP_USER, "fred"); ctx.setObjectPart(org.apache.wsif.WSIFConstants.CONTEXT_HTTP_PSWD, "cat"); dpf.setContext(ctx); I use this , because I want to implement a basic
authentication to my web service.
If I look at the HTTP headres i can
get:
POST /axis/services/diplayInfo
HTTP/1.0
Content-Type: text/xml; charset=utf-8 Accept: application/soap+xml, application/dime, multipart/related, text/* User-Agent: Axis/1.1 Host: fisiere:8080 Cache-Control: no-cache Pragma: no-cache SOAPAction: "" Content-Length: 451 Authorization: Basic ZnJlZDpjYXQ= In the same DynamicInvoker.java I add th followig
line of code:
//This line it was added WSIFPluggableProviders.overrideDefaultProvider("http://schemas.xmlsoap.org/wsdl/soap/"
, new WSIFDynamicProvider_ApacheSOAP());
after this code that already exist in this sample:
if
("axis".equals(protocol))
{
WSIFPluggableProviders.overrideDefaultProvider( "http://schemas.xmlsoap.org/wsdl/soap/", new WSIFDynamicProvider_ApacheAxis()); } . But after that change I couln't send the username
and password. This is what I've get from sniff HTTP protocol:
POST /axis/services/diplayInfo HTTP/1.0
Host: wserv1:8080 Content-Type: text/xml; charset=utf-8 Content-Length: 449 SOAPAction: "" <?xml version='1.0' encoding='UTF-8'?> .... Can anyone help me to send this information with
this provider?
Thanks in advance,
Raul Gereanu,
Techical Consultant
FIBa Software
http://www.fiba.ro
mailto: [EMAIL PROTECTED]
|
- Basic Authentication Gereanu Raul
- Authorization Rod Frans
