axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Walker, Jeff" <Jeff.Wal...@fmr.com>
Subject RE: Axis and wss4j debugging
Date Mon, 06 Aug 2007 21:10:56 GMT
I don't know wss4j from a hole in the ground,
but you can programmatically set handlers using this kind of approach:

try {
  //======================================
  //Register Clientside Handler
  //======================================
  //PaGWebService_ServiceLocator locator = new
PaGWebService_ServiceLocator();
  javax.xml.namespace.QName portName = new
javax.xml.namespace.QName("sessions", "PaGWebService");
  javax.xml.rpc.handler.HandlerRegistry hr =
locator.getHandlerRegistry();
  java.util.List handlerChain = hr.getHandlerChain(portName);
  javax.xml.rpc.handler.HandlerInfo hInfo = new
javax.xml.rpc.handler.HandlerInfo();
  hInfo.setHandlerClass(client.ClientSideHandler.class);
  handlerChain.add(hInfo);
}
catch (Exception e) {
  System.out.println("Caught an exception when registering the
clientside handler: " + e.getMessage());
}

You'll need the QName WSDoAllSender belongs too to get it right, I
think.
Hope it helps,
-jeff
 

-----Original Message-----
From: Hillel Seltzer [mailto:hseltzer@larich.com] 
Sent: Monday, August 06, 2007 4:56 PM
To: axis-user@ws.apache.org
Subject: RE: Axis and wss4j debugging

Continuing the saga of using axis with wss4j, I seem to have hit
a roadblock with getting the wsdd file to work.  The web service
I am trying to contact uses https, and I am using stubs generated
by WSDL2Java.  

If I do not use a wsdd file, then all of the connections seem to 
work properly, I just get a SOAP error of missing the security token.
That's good.  Then I tried to add the wsdd file for adding the
UserName token with plain text password according to the examples
on the wss4j site.  For some reason, the transport just returns
without actually trying to establish a connection.  I know that
the client is reading the wsdd file because the userName security
token is there in the SOAP header in the XML of the debug log.

I then tried using just the wsdd file without the wss4j security 
information, just the "transport" option defined, and got the 
same result of no connection, just a null return.  I also received
the same results if using HTTPSender or CommonsHTTPSender for
the http transport.

The wsdd file and debug log sections following the full XML listings
are included in this message.

(a) What am I doing wrong in the wsdd?
(b) Is there a way to tell axis programmatically to use the
WSDoAllSender handler without the wsdd file?  (I already
know how to set the username and password callback parameters
programmatically.  I just cannot find how to set the handler
to begin with.)


WSDD file:
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
  <transport name="http"
class="org.apache.axis.transport.http.HTTPSender"/>
  <globalConfiguration >
  <requestFlow>
   <handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
    <parameter name="action" value="UsernameToken"/>
    <parameter name="user" value="myUser"/>
    <parameter name="passwordType" value="PasswordText" />
    <parameter name="passwordCallbackClass"
value="larich.getohtax.PWCallback"/>
  </handler>
  </requestFlow>
  </globalConfiguration >
</deployment>

Debug log for client with above wsdd file, lines following
the full XML SOAP listing:
- Send request: total= 223 request preparation= 173 request processing=
25
request to Axis= 25
- WSDoAllSender: exit invoke()
- Exit: SimpleChain::invoke
- Exit: SimpleChain::invoke
- Enter: SimpleChain::invoke
- Enter: SimpleChain::invoke
- Exit: SimpleChain::invoke
- Exit: SimpleChain::invoke
- org.apache.axis.i18n.resource::handleGetObject(semanticCheck00)
- org.apache.axis.i18n.resource::handleGetObject(semanticCheck00)
- Doing SOAP semantic checks...
- Doing SOAP semantic checks...
- Exit: AxisClient::invoke
- Exit: AxisClient::invoke
- Exit: Call::invoke()
- Exit: Call::invoke()
- Exit: Call::invoke(ns, meth, args)
- Exit: Call::invoke(ns, meth, args)
- axis.Call.invoke: 2312 GetOHSalesTaxByZipCode
- axis.Call.invoke: 2312 GetOHSalesTaxByZipCode


Debug log for client without wsdd file, lines following the
full XML SOAP listing:
- Enter: AxisClient::invoke
- Enter: AxisClient::invoke
- EngineHandler: null
- EngineHandler: null
- org.apache.axis.i18n.resource::handleGetObject(axisUserAgent)
- org.apache.axis.i18n.resource::handleGetObject(axisUserAgent)
- Enter: SimpleChain::invoke
- Enter: SimpleChain::invoke
- org.apache.axis.i18n.resource::handleGetObject(enter00)
- org.apache.axis.i18n.resource::handleGetObject(enter00)
- Enter:  HTTPSender::invoke
- Enter:  HTTPSender::invoke
- Enter: SOAPPart::saveChanges
- Enter: SOAPPart::saveChanges
- org.apache.axis.i18n.resource::handleGetObject(register00)
- org.apache.axis.i18n.resource::handleGetObject(register00)
- register 'soapenv' - 'http://schemas.xmlsoap.org/soap/envelope/'
- register 'soapenv' - 'http://schemas.xmlsoap.org/soap/envelope/'
- NSPush (32)
- NSPush (32)
- NSPush (32)
- NSPush (32)
- org.apache.axis.i18n.resource::handleGetObject(register00)
- org.apache.axis.i18n.resource::handleGetObject(register00)
- register 'soapenv' - 'http://schemas.xmlsoap.org/soap/envelope/'
- register 'soapenv' - 'http://schemas.xmlsoap.org/soap/envelope/'
- org.apache.axis.i18n.resource::handleGetObject(register00)
- org.apache.axis.i18n.resource::handleGetObject(register00)
- register 'xsd' - 'http://www.w3.org/2001/XMLSchema'
- register 'xsd' - 'http://www.w3.org/2001/XMLSchema'
- NSPush (32)
- NSPush (32)
- org.apache.axis.i18n.resource::handleGetObject(register00)
- org.apache.axis.i18n.resource::handleGetObject(register00)
- register 'xsi' - 'http://www.w3.org/2001/XMLSchema-instance'
- register 'xsi' - 'http://www.w3.org/2001/XMLSchema-instance'
- NSPush (32)
- NSPush (32)
<...similar entries for each SOAP body element...>
- NSPop (empty)
- NSPop (empty)
- org.apache.axis.i18n.resource::handleGetObject(setMsgForm)
- org.apache.axis.i18n.resource::handleGetObject(setMsgForm)
- Setting current message form to: FORM_OPTIMIZED (currentMessage is now
org.apa
che.axis.utils.ByteArray)
- Setting current message form to: FORM_OPTIMIZED (currentMessage is now
org.apa
che.axis.utils.ByteArray)
- Exit: SOAPPart::saveChanges():
org.apache.axis.utils.ByteArray@4e542ad6
- Exit: SOAPPart::saveChanges():
org.apache.axis.utils.ByteArray@4e542ad6
- Enter: SOAPPart::saveChanges
- Enter: SOAPPart::saveChanges
- Enter: SOAPPart::saveChanges
- Enter: SOAPPart::saveChanges
- org.apache.axis.i18n.resource::handleGetObject(createdSSL00)
- org.apache.axis.i18n.resource::handleGetObject(createdSSL00)
- Created an SSL connection
- Created an SSL connection
- org.apache.axis.i18n.resource::handleGetObject(xmlSent00)
- org.apache.axis.i18n.resource::handleGetObject(xmlSent00)
- XML sent:
- XML sent:
- ---------------------------------------------------
- ---------------------------------------------------
- Enter: SOAPPart::saveChanges
- Enter: SOAPPart::saveChanges
- POST /OHFinderService/OHFinderService.asmx HTTP/1.0^
Content-Type: text/xml; charset=utf-8^
Accept: application/soap+xml, application/dime, multipart/related,
text/*
User-Agent: Axis/1.4
Host: thefinder.tax.ohio.gov
Cache-Control: no-cache
Pragma: no-cache
SOAPAction:
"https://thefinder.tax.ohio.gov/OHFinderService/GetOHSalesTaxByZipCode"
Content-Length: 653



Thanks.
---Hillel


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message