I think i found the problem in the DeploymentDescriptor class fromXML
method, the isd:option prop hashtable is only initialized when the service
type is NOT java or script. Because my service is java, it was bypassing the
prop hashtable initialization section.
Please add the following section in DeploymentDescriptor.java in TYPE java
section
nl =
root.getElementsByTagNameNS(Constants.NS_URI_XML_SOAP_DEPLOYMENT,
"option" );
for ( int i = 0 ; nl != null && i < nl.getLength() ; i++ ) {
String key, value ;
System.err.println("nl length is "+nl.getLength());
e = (Element) nl.item(i);
key = DOMUtils.getAttribute( e, "key" );
value = DOMUtils.getAttribute( e, "value" );
if ( dd.props == null ) dd.props = new Hashtable();
dd.props.put( key, value );
}
In addition, i think "isd:option" initialization should NOT be related to
service type. In the current version options hashtable only initialized when
the service is NOT java or script
Regards,
------------------------------------------------------------------
Doug,
I tried the example u sent below and it fails because Hashtable props =
dd.getProps(); returns null. I think my "option"(I used isd:option as shown
below) xml element name is either incorrect or misplaced. My deployement
descriptor is below, please let me know how if the init parms should be
placed and/or named.
------------------------------------------- DD
----------------------------------------------------
<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
id="urn:my-test- service" type="message">
<isd:provider type="java"
scope="Request"
methods="testMethod">
<isd:java class="simplexis.bulk.process.BulkUploadManager"
static="false"/>
<isd:option key="jdbc-driver-name" value="com.oracle .. "/>
<isd:option key="tnsname" value="mydb"/>
<isd:option key="db-port-no" value="1521"/>
</isd:provider>
<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListene
r>
</isd:service>
---------------------------------------------- DD
----------------------------------------------------
Regards,
-----Original Message-----
From: Doug Davis [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 09, 2001 4:29 PM
To: [EMAIL PROTECTED]
Subject: Re: setting init parms for non-EJB java service
I just checked in a change that will add the DeploymentDescriptor object
to the "bag" in the SOAPContext:
dd = cntxt.getProperty(Constants.BAG_DEPLOYMENTDESCRIPTOR);
Once you have the DD you can query its options:
Hashtable props = dd.getProps();
String value = (String) props.get( "myoption" );
Grab either the latest code or tonight's build.
-Dug
Uzay Takaoglu <[EMAIL PROTECTED]> on 07/09/2001 01:51:14 PM
Please respond to [EMAIL PROTECTED]
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
cc:
Subject: setting init parms for non-EJB java service
Hi All,
I'm using SOAP 2.2 on Linux. Is it possible to pass set of init paramters
to
a non-EJB SOAP java component? E.g. Just like servlets passing a config
instance to init() method.
The sample for the EJB service deployment descriptor contains
<isd:option key="" value=""/>, can we use the same thing for non-EJB java
components? If yes, how do we retrieve the values of the keys?
Using SOAPContext.getProperty(String key) for request or response?
P.S: I used the messagerouter so my service has a method receiving
org.apache.soap.Envelope envelope,
org.apache.soap.rpc.SOAPContext request,
org.apache.soap.rpc.SOAPContext response
parameters
Regards,