Hi everyone,

I currently have a complex webservice (beans) in JBoss and axis1.1. I
also use handlers on the client and server sides. In this web service
the client sends a string in response and returns a complex
type(s)(beans) in response. This works fine.
I now add my own security handlers to the client and server side. On the
server side this is deployed via deploy.wsdd and on the client side I
use static deployment of the deploy.wsdd file as a string (see the
cleint stub below). Could this be the problem or do I use
setClienthandlers(reqHandler, resHandler) method in my source code for
this. I also create log files before and after security handler
processing.
The client seems to decrypt and verify the encrypted and signed response
from the server correctly, but this error ( shown below) as a trace is
received after the handler has finished processing successfully. But
this error is not there when the handlers are not used. I am bit
confused and baffled. Some pointers would be useful.
I am attaching the following snips below:

< snip of trace output after handler works on the client side>

THIS IS INVOKING THE SIGN/ENCR HANDLER
THIS IS INVOKING THE VERFY/DECR HANDLER

- Exception:
org.xml.sax.SAXException: Deserializing parameter
'getJobDetail_NCReturn':  could not find deserializer for type
{http://schemas.test.com/types}sco_ws_get_job_detailOutput

 at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:302)

 at
org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:963)

 at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:198)

 at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:722)

 at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:233)
 at org.apache.axis.message.RPCElement.getParams(RPCElement.java:347)
 at org.apache.axis.client.Call.invoke(Call.java:2272)
 at org.apache.axis.client.Call.invoke(Call.java:2171)
 at org.apache.axis.client.Call.invoke(Call.java:1691)
 at
com.test.schemas.M4JobService_NC_secSoapBindingStub.getJobDetail_NC(M4JobService_NC_secSoapBindingStub.java:194)

 at
com.test.schemas.M4JobService_NC_Client.getJob(M4JobService_NC_Client.java:45)

 at
com.test.schemas.M4JobService_NC_Client.doClientTasks(M4JobService_NC_Client.java:28)

 at
com.test.schemas.M4JobService_NC_Client.main(M4JobService_NC_Client.java:20)

<---------end of snip tace output at client side----------------->



<server_deploy.wsdd>


<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
 M4JobService_NC_sec
 WEB-INF/classes/com/test/soapservices/services/rpc/M4JobService_NC_sec/deploy.wsdd

-->


<deployment xmlns="http://xml.apache.org/axis/wsdd/";
 xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";
 xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance";>

<!--Service request handler -->
<handler name="Sign-Encr" type ="java:mySignandEncrHandler">
</handler>
<!--Service response handler -->
<handler name="Verfy-Decr" type ="java:uos.myVerfyandDecrHandler">
</handler>

 <service name="M4JobService_NC_sec" provider="java:RPC" >
  <namespace>http://schemas.test.com/</namespace>

  <!-- begin comments
  <parameter name="scope" value="{request/session/application}"/>
   "request" will get you a new object each request.
   "application" uses a singleton (which should be thread-safe).
   "session" uses either HTTP sessions or SOAP headers to get an object
per connection with timeouts.
  end comments -->

  <requestFlow>
   <handler type="Verfy-Decr"/>
  </requestFlow>
  <responseFlow>
   <handler type="Sign-Encr"/>
  </responseFlow>

  <parameter name="scope" value="session"/>
  <parameter name="className"
value="com.test.soapservices.services.rpc.M4JobService_NC_sec.M4JobService_NC"/>

  <parameter name="allowedMethods" value="getJobDetail_NC" />

  <!-- logmessage -->
  <typeMapping
   qname="test:logMessage"
   xmlns:test="http://schemas.test.com/types";
   languageSpecificType="java:com.test.m4operations.LogMessage"
   serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
   deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
  />


  <!-- JOB -->

  <!-- method getJobDetail  -->
  <typeMapping
   qname="test:sco_ws_get_job_detailOutput"
   xmlns:test="http://schemas.test.com/types";

languageSpecificType="java:com.test.soapservices.services.rpc.M4JobService_NC_sec.M4sco_ws_get_job_detailOutput"

   serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
   deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
  />

  <!-- node SCO_WS_JOB_DETAIL -->
  <typeMapping
   qname="test:sco_ws_job_detailBlock"
   xmlns:test="http://schemas.test.com/types";

languageSpecificType="java:com.test.soapservices.services.rpc.M4JobService_NC_sec.M4sco_ws_job_detailBlock"

   serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
   deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
  />

  <typeMapping
   qname="test:sco_ws_job_detailRecord"
   xmlns:test="http://schemas.test.com/types";

languageSpecificType="java:com.test.soapservices.services.rpc.M4JobService_NC_sec.M4sco_ws_job_detailRecord"

   serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
   deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
  />

 </service>
</deployment>


--------------end of server_deploy.wsdd file
-----------------------------




< snip of  M4JobService_NC_secSoapBindingStub--------------->


(...)

    public M4JobService_NC_secSoapBindingStub(javax.xml.rpc.Service
service) throws org.apache.axis.AxisFault {
       if (service == null) {
      Service serv = new org.apache.axis.client.Service();
   String client_wsdd = "<deployment xmlns=
\"http://xml.apache.org/axis/wsdd/\"; " +
                               "xmlns:java=
\"http://xml.apache.org/axis/wsdd/providers/java\";> \n" +
                               "<transport name= \"http\" pivot=
\"java:org.apache.axis.transport.http.HTTPSender\"/>\n" +
                               "<transport name= \"local\" pivot=
\"java:org.apache.axis.transport.local.LocalSender\"/>\n" +
                               "<transport name= \"java\" pivot=
\"java:org.apache.axis.transport.java.JavaSender\"/>\n" +
                               "<service name= \"M4JobService_NC\"
provider= \"java:RPC\"> \n" +
                               "<parameter name= \"className\" value=
\"com.test.soapservices.services.rpc.M4JobService_NC.M4JobService_NC\"/>\n"
+
                               "<parameter name= \"allowedMethods\"
value= \"getJobDetail_NC\"/>\n" +
                               "<requestFlow>\n" +
                               "<handler type=
\"java:mySignandEncrHandler\"/>\n" +
                               "</requestFlow>\n" +
                               "<responseFlow>\n" +
                               "<handler type=
\"java:myVerfyandDecrHandler\"/>\n" +
                               "</responseFlow>\n" +
                               "<beanMapping
xmlns:test=\"http://schemas.test.com/types\"; languageSpecificType=
\"java:com.test.m4operations.LogMessage\" qname=\"test:logMessage\"
/>\n" +
                               "<beanMapping
xmlns:test=\"http://schemas.test.com/types\"; languageSpecificType=
\"java:com.test.soapservices.services.rpc.M4JobService_NC_sec.M4sco_ws_get_job_detailOutput\"
qname=\"test:sco_ws_get_job_detailOutput\" />\n" +
                               "<beanMapping
xmlns:test=\"http://schemas.test.com/types\"; languageSpecificType=
\"java:com.test.soapservices.services.rpc.M4JobService_NC_sec.M4sco_ws_job_detailBlock\"
qname=\"test:sco_ws_job_detailBlock\" />\n" +
                               "<beanMapping
xmlns:test=\"http://schemas.test.com/types\"; languageSpecificType=
\"java:com.test.soapservices.services.rpc.M4JobService_NC_sec.M4sco_ws_job_detailRecord\"
qname=\"test:sco_ws_job_detailRecord\" />\n" +
                               "</service>\n" +
                               "</deployment>";
   EngineConfiguration config = new XMLStringProvider(client_wsdd);
   AxisClient client =new AxisClient(config);
   serv.setEngine(client);
   super.service = serv;
  } else {
   super.service = service;
  }

  java.lang.Class cls;
  javax.xml.namespace.QName qName;
  java.lang.Class beansf =
org.apache.axis.encoding.ser.BeanSerializerFactory.class;
  java.lang.Class beandf =
org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
  java.lang.Class enumsf =
org.apache.axis.encoding.ser.EnumSerializerFactory.class;
  java.lang.Class enumdf =
org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
  java.lang.Class arraysf =
org.apache.axis.encoding.ser.ArraySerializerFactory.class;
  java.lang.Class arraydf =
org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
  java.lang.Class simplesf =
org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
  java.lang.Class simpledf =
org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
  qName = new javax.xml.namespace.QName("http://schemas.test.com/types";,
"logMessage");
  cachedSerQNames.add(qName);
  cls = com.test.schemas.types.LogMessage.class;
  cachedSerClasses.add(cls);
  cachedSerFactories.add(beansf);
  cachedDeserFactories.add(beandf);

  qName = new javax.xml.namespace.QName("http://schemas.test.com/types";,
"sco_ws_job_detailBlock");
  cachedSerQNames.add(qName);
  cls = com.test.schemas.types.Sco_ws_job_detailBlock.class;
  cachedSerClasses.add(cls);
  cachedSerFactories.add(beansf);
  cachedDeserFactories.add(beandf);

  qName = new
javax.xml.namespace.QName("http://exception.soapservices.test.com";,
"M4SoapException");
  cachedSerQNames.add(qName);
  cls = com.test.soapservices.exception.M4SoapException.class;
  cachedSerClasses.add(cls);
  cachedSerFactories.add(beansf);
  cachedDeserFactories.add(beandf);

  qName = new javax.xml.namespace.QName("http://schemas.test.com/types";,
"sco_ws_get_job_detailOutput");
  cachedSerQNames.add(qName);
  cls = com.test.schemas.types.Sco_ws_get_job_detailOutput.class;
  cachedSerClasses.add(cls);
  cachedSerFactories.add(beansf);
  cachedDeserFactories.add(beandf);

  qName = new javax.xml.namespace.QName("http://schemas.test.com/";,
"ArrayOf_tns1_logMessage");
  cachedSerQNames.add(qName);
  cls = com.test.schemas.types.LogMessage[].class;
  cachedSerClasses.add(cls);
  cachedSerFactories.add(arraysf);
  cachedDeserFactories.add(arraydf);

  qName = new javax.xml.namespace.QName("http://schemas.test.com/";,
"ArrayOf_tns1_sco_ws_job_detailRecord");
  cachedSerQNames.add(qName);
  cls = com.test.schemas.types.Sco_ws_job_detailRecord[].class;
  cachedSerClasses.add(cls);
  cachedSerFactories.add(arraysf);
  cachedDeserFactories.add(arraydf);

  qName = new javax.xml.namespace.QName("http://schemas.test.com/types";,
"sco_ws_job_detailRecord");
  cachedSerQNames.add(qName);
  cls = com.test.schemas.types.Sco_ws_job_detailRecord.class;
  cachedSerClasses.add(cls);
  cachedSerFactories.add(beansf);
  cachedDeserFactories.add(beandf);

    }


(...)


-----------end of
M4JobService_NC_secSoapBindingStub---------------------------------------




Cheers
Sunny


--
***********************************************************
Sunil Iyengar,
Research Fellow, Networks Group,
Centre For Communication And Systems Research(CCSR),
School of Electronics, Computing & Mathematics,
University Of Surrey, Guildford GU2 7XH,
Surrey, England, United Kingdom.
Office: +44 (0)1483 686008
***********************************************************


Reply via email to