sriraman seshadri

+ Follow
since May 25, 2010
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sriraman seshadri

I have XML (of size around 2 MB) that I need to parse using JAXB but have no control over the creation of the XML. XML comes from a thrid party.
Unfortunately XML contains things like:
<name>James & Colin</name>
And when i fed the xml to the jaxb parser it gave me an error as
"The entity name must immediately follow the '&' in the entity reference"

Is there a work around for this in JAXB? I need to parse the <name> element as "James & Colin"

When i googled for solution i get solutions like change & to & . But i dont have control over the creation of xml.

Thanks for your response.

Currently our prod and uat servers are maintained by IBM. IBm have installed a JRE in those servers and have created the weblogic domains with JAVA_HOME as IBM jre.
We are not using axis2. We are using axis1.2.
Ours is a struts based web application which connects to EJB which is deployed in a different (remote) weblogic server. The EJB uses axis 1.2 to connect to a third party (connects through SSL). The EJB is packaged as a jar file which has a META-INF folder (which has the and other xml files) and the other auxillary jars which is used by the EJB.
The exception is thrown from the EJB module. And this exception is thrown when call.invoke method is called. Once this method is called the control goes to the axis1.2.jar.
We dont have web.xml or weblogic.xml or weblogic-application.xml in the ejb module. We have only the META-INF folder and the ejb.jar in the domains/{domain-name}/applications folder of the weblogic server
Is there a way to set an option like prefer-webinf-classes settings in ejb xml files ? or is there a place in the ejb jar where we can set this setting ?
8 years ago

We are currently having a soap client as below

SOAPConnectionFactory soapConnFactory = SOAPConnectionFactory.newInstance();
SOAPConnection connection = soapConnFactory.createConnection();

URL url = new URL("http://localhost:8001/ws/services/TestService");

SOAPMessage msg = message;

SOAPMessage reply =,url );

This works fine for HTTp connection. Now we need to change it to HTTS connection.
We have installed the server certificate in our local machine.
now we need to change the above client code to support https.
One solution is to set the system properties
(System.setProperty("", "")
System.setProperty("", "")
System.setProperty("", "")
System.setProperty("", ""))

Is there any other way other than setting the system property to achieve https connection in SAAJ ?

8 years ago

Thanks for your speedy reply
We are currently using axis 1.2
We are not facing this issue when we use SUN JRE 1.4
We are facing this issue in UAT an PROD because in those environment we have IBM JRE 1.4.
IBM JRE 1.4 has a jar file named xml.jar which has Element.class which doesnt have this getTextContent() method.
But Sun JRE 1.4 doesnt have this xml.jar file in its lib folder.
8 years ago

We are calling a web service over HTTPS , using axis 2.
We get the below error when call.invoke() method is invoked
This error is not occurring in our local machine where we have Weblogic 8 server with sun JRE.
This error is occuring in UAT/PROD machines where we have Weblogic 8 server with IBM jre.
Google says to upgrade to JAVA5. But we cant upgrade or endorse any jar files.
Currently we have axis jars (and our application's service.jar) in the EJB classpath
Is there any work around solution for this ?

java.lang.NoSuchMethodError: org.w3c.dom.Element: method getTextContent()Ljava/lang/String; not found
at org.apache.axis.AxisFault.makeFault(
at org.apache.axis.transport.http.HTTPSender.invoke(
at org.apache.axis.strategies.InvocationStrategy.visit(
at org.apache.axis.SimpleChain.doVisiting(
at org.apache.axis.SimpleChain.invoke(
at org.apache.axis.client.AxisClient.invoke(
at org.apache.axis.client.Call.invokeEngine(
at org.apache.axis.client.Call.invoke(
at org.apache.axis.client.Call.invoke(
8 years ago

We are currently using dojo as UI along with struts.
Whenever a dojo page is submitted, the form values are getting populated in the formbeans.

Can anyone suggest a link where we can get information on "How to integrate dojo with struts?" or on "Dojo tutorials"
9 years ago

We are using Apache axis to connect to external party.
We use call.invoke(soapEnvelope) to send soap messages to them.

Now we need to communicate to the thrid party using SSL.
The server will authenticate the client (whether the request is coming from the trusted client)
We (The client) need not authenticate the server. The client will accept the responses from all the servers

We have the server certificate which we have imported into JKS file

We have set the following properties before calling call.invoke()
AxisProperties.setProperty("", "TestSOAPService");
AxisProperties.setProperty("keystore", "/tmp/java/keystore.jks");
AxisProperties.setProperty("keystorePassword", "h4CXm?R*n/9zg");
AxisProperties.setProperty("keystoreType", "JKS");

The belwo method is present in the TestSOAPService to get SSl context
protected SSLContext getContext() throws IOException {
try {
if (attributes == null || (attributes.get("keystore") == null && attributes.get("truststore") == null)) {
SSLContext context = SSLContext.getInstance(DEFAULT_PROTOCOL);
context.init(null, null, null);
return context;

String protocol = getProtocol();

KeyManager[] keyManagers = getKeyManagers();

SSLContext sslContext = SSLContext.getInstance(protocol);
//trust manager is set to null because we trust the server
sslContext.init(keyManagers, null, null);

return sslContext;
} catch (NoSuchAlgorithmException e) {
throw new IOException("Exception trying to load sslContext "
+ e.getMessage());
} catch (KeyManagementException e) {
throw new IOException("Exception trying to load sslContext "
+ e.getMessage());

When we tried to invoke the service we are getting SSL HandShake exception: Unknown certificate.
Is there any additional properties need to be set ?
Is there any other way to send soap message?

9 years ago