Ok, I figured out how to fix AddressBook sample.  Just on case somebody else will struggle, please have these advices.

 

So, to get SimpleSessionHandler invoked on client side, you need to use special client-config.wsdd.  I added the following method to Main class from sample:

 

AddressBookService getService() throws Exception

    {

        String clientWsdlLocation = "C:/Proj/learn/config/client-config-AddressBook.wsdd";

        InputStream is = new FileInputStream(clientWsdlLocation);

        WSDDDocument doc = new WSDDDocument(XMLUtils.newDocument(is));

        WSDDDeployment deployment = doc.getDeployment();

        

        QName serviceName = new QName("AddressBook");;

        AddressBookService service = new AddressBookServiceLocator(deployment);

 

        return service;

    }

 

Now, in Main class, call

        AddressBookService abs = new AddressBookServiceLocator();

got replaced for

        AddressBookService abs = getService();

 

Client-config-AddressBook.wsdd file look like this:

 

<?xml version="1.0" encoding="UTF-8"?>

<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

 <transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSender"/>

 <transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender"/>

 <transport name="java" pivot="java:org.apache.axis.transport.java.JavaSender"/>

       

 <handler name="smplSession" type="java:aly.learn.webSrvs.handlers.SimpleSessionHandler"/>

 

<!--globalConfiguration>

  <requestFlow> <handler type="smplSession"/> </requestFlow>

  <responseFlow> <handler type="smplSession"/> </responseFlow>

 </globalConfiguration-->

 

   <service name="AddressBook">

      <requestFlow> <handler type="smplSession"/> </requestFlow>

      <responseFlow> <handler type="smplSession"/> </responseFlow>

   </service>

 

</deployment>

 

Note, that you can desine header on globalConfiguration level or on service level, both works.

And I didn’t toutch client-config.wsdd in axis.jar.

 

Reply via email to