saravanan periasamy

Greenhorn
+ Follow
since Feb 06, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by saravanan periasamy

Hi All,


I am using JBoss log setup for my application.I did configuration for my application to log data in separate file from <JBoss_Home>/config/jboss-log4j.xml by adding my FileAppender. But my application get stored in two files (my appliation log file and server.log file). I do not know how to avoid logging my application specific log data in <JBoss_Home>/log/server.log.



Thanks in advance,
Saravanan
14 years ago
I have tested static client calling using handler simple above service and found the issues.


QName portName = new QName(namespace,

"RemoteServicePortType");


The above line code has created the issues,becuase in wsdl file ( given similar wsdl file).


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

<definitions name="HelloService"

targetNamespace="http://www.ecerami.com/wsdl/HelloService.wsdl"

xmlns="http://schemas.xmlsoap.org/wsdl/"

xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"

xmlns:tns="http://www.ecerami.com/wsdl/HelloService.wsdl"

xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<message name="SayHelloRequest">

<part name="firstName" type="xsd:string"/>

</message>

<message name="SayHelloResponse">

<part name="greeting" type="xsd:string"/>

</message>

<portType name="RemoteServicePortType">

<operation name="sayHello">

<input message="tns:SayHelloRequest"/>

<output message="tns:SayHelloResponse"/>

</operation>

</portType>

<binding name="Hello_Binding" type="tns:RemoteServicePortType">

<soap:binding style="rpc"

transport="http://schemas.xmlsoap.org/soap/http"/>

<operation name="sayHello">

<soap:operation soapAction="sayHello"/>

<input>

<soap:body

encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"

namespace="urn:examples:helloservice"

use="encoded"/>

</input>

<output>

<soap:body

encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"

namespace="urn:examples:helloservice"

use="encoded"/>

</output>

</operation>

</binding>

<service name="Hello_Service">

<port binding="tns:Hello_Binding" name="RemoteServicePortType1">

<soap:address

location="http://host1:8080/soap/servlet/rpcrouter"/>

</port>

<port binding="tns:Hello_Binding" name="RemoteServicePortType2">

<soap:address

location="http://host2:8080/soap/servlet/rpcrouter"/>

</port>

<port binding="tns:Hello_Binding" name="RemoteServicePortType3">

<soap:address

location="http://host3:8080/soap/servlet/rpcrouter"/>

</port>

<port binding="tns:Hello_Binding" name="RemoteServicePortType4">

<soap:address

location="http://host4:8080/soap/servlet/rpcrouter"/>

</port>


</service>

</definitions>


From the above WSDL, I have four port name (port binding="tns:Hello_Binding" name="RemoteServicePortType1) which is not matching with PortType (portType name="RemoteServicePortType")

even i have iterated from getPorts() method and used to invoke the service.But handler was not calling when i invoke.

Please suggest me how i specify correct portname which can call Handler class also.

Thanks in advance,
pps
15 years ago
Hi All,

I have two web service ServiceA & ServiceB and both implemented in weblogic.

The ServiceA is SSL enable and protocol is https which is not published by me.
The ServieB is my web service(wls8.1) and act as client for ServiceA.

My problem is when i hit my service, its not able set the handler when it call ServiceA but it is invoking the service and giving application exception like authentication error.

My service file:

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.xml.namespace.QName;
import javax.xml.rpc.handler.HandlerInfo;
import javax.xml.rpc.handler.HandlerRegistry;
import javax.xml.rpc.handler.soap.SOAPMessageContext;

import weblogic.webservice.client.SSLAdapterFactory;
import weblogic.webservice.client.WLSSLAdapter;

public class HelloService {

String wsdl = "https://188.122.123.23/RemoetService?WSDL";

static {
SSLAdapterFactory factory = SSLAdapterFactory.getDefaultFactory();
WLSSLAdapter adapter = (WLSSLAdapter) factory.getSSLAdapter();
adapter.setTrustedCertificatesFile("D:\\lib\\certs
cacerts");
factory.setDefaultAdapter(adapter);
System.setProperty("weblogic.xml.encryption.verbose","true");
System.setProperty("weblogic.xml.signature.verbose","true");
System.setProperty("weblogic.webservice.verbose","true");
}

public String sayHello(String user) {

RemoteService_Impl service = new RemoteService_Impl(wsdl);
RemotePortType port = service.getRemoteServicePort1();

String namespace = service.getServiceName()
.getNamespaceURI();

QName portName = new QName(namespace,
"RemoteServicePortType");

HandlerRegistry reg = service.getHandlerRegistry();

List handlerList = new ArrayList();

Map map = new HashMap();
map.put("Username", "user1");
map.put("Password", "pwd1");

HandlerInfo info = new HandlerInfo();
info.setHandlerClass(WSClientHandler .class);
info.setHandlerConfig(map);

handlerList.add(info);

reg.setHandlerChain(portName,(List)handlerList);
RemoteServiceResponse = port.callMe(name);

}

}

My Handler Class:

package com.test;

import java.util.Map;

import javax.xml.namespace.QName;
import javax.xml.rpc.handler.Handler;
import javax.xml.rpc.handler.HandlerInfo;
import javax.xml.rpc.handler.MessageContext;
import javax.xml.rpc.handler.soap.SOAPMessageContext;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPHeaderElement;

public class WSClientHandler implements Handler {

private HandlerInfo handlerInfo;

public WSClientAuthenticateHandler(){}

public void init(HandlerInfo hi) {
System.out.println("Handler init");
handlerInfo = hi;
}

public void destroy() {
System.out.println("Handler destroy method called");
handlerInfo = null;
}

public QName[] getHeaders() {
System.out.println("Handler Header method called");
try {
Map map = handlerInfo.getHandlerConfig();
QName[] headers = handlerInfo.getHeaders();
System.out.println(" Config :"+map);
for(int i=0;i<headers.length;i++) {
System.out.println(headers.getLocalPart()+" "+
headers.toString()+" "+headers.getNamespaceURI());
}
}catch(Exception e) {
e.printStackTrace();
}

return handlerInfo.getHeaders();
}

public boolean handleRequest(MessageContext mc) {

SOAPMessageContext smc = (SOAPMessageContext) mc;

System.out.println("Calling handler class.....................");

try {
SOAPEnvelope se = smc.getMessage().getSOAPPart().getEnvelope();

System.out.println("Calling handler class.....................");
SOAPHeader soapHeader = se.getHeader();
Name headerName = se.createName("Security","wsse","http://schemas.xmlsoap.org/ws/2002/07/secext");
SOAPHeaderElement headerElement = soapHeader.addHeaderElement(headerName);
SOAPElement element = headerElement.addChildElement(se.createName("UsernameToken", "wsse", "http://schemas.xmlsoap.org/ws/2002/07/secext"));
element.addChildElement(se.createName("Username", "wsse","http://schemas.xmlsoap.org/ws/2002/07/secext")).addTextNode("testuser");
element.addChildElement(se.createName("Password", "wsse","http://schemas.xmlsoap.org/ws/2002/07/secext")).addTextNode("testpwd");

System.out.println("Calling handler class.....................");
System.out.println("** Request: \n "se.toString()"\n");
}catch(SOAPException e) {
e.printStackTrace();
}

return true;
}

/** * Specifies that the SOAP response message be logged to a
* log file before the
* * message is sent back to the client application
* that invoked the Web service.
* */

public boolean handleResponse(MessageContext mc) {
System.out.println("Handler Response method called");
SOAPMessageContext messageContext = (SOAPMessageContext) mc;
System.out.println("** Response: \n"messageContext.getMessage().toString()"\n");
return true;
}

/** * Specifies that a message be logged to the log file if a SOAP fault is
* * thrown by the Handler instance.
* */

public boolean handleFault(MessageContext mc) {
SOAPMessageContext messageContext = (SOAPMessageContext) mc;
System.out.println("** Fault: \n"messageContext.getMessage().toString()"\n");
return true;
}

}


Please need help here.

Thanks in Advance,
pps>
15 years ago
Hi Friends,

I am new to this Java security concepts, I do not even know the terminology like truststore, keystore, certificates, public key, private key, alias name, which one need to use where and etc.,

But i know my requirement exactly,

I got a servlet url from my client which is running under SSL enabled server. But they do not share any information about it.

Should I need to get some more information from them or this is enough to go further?

I tried to get the certificate from the url. I invoked the servlet from web browser authenticating using user name and password. Actually the servlet will print as xml format.

My requirement is very clear that, I need to get the xml stream and display it my java client program

For the reason, I have exported the certificate from the web browser itself as Base 64 format - cer.

So i am stuck here, how I can move further,

Is the certificate valid one which I exported to communicate to server?

If how do i write a program to use that?

This issue is killing me. So please help me out, giving right direction to succeed in step by step with sample program. That would be great.

Thanks in Advance,
Saravanan
17 years ago
Friends

Is it possible to run the java script in Java FX product?.

Thanks.
Hi,

When do we get the API Documentation for JAVA FX from Sun.

Thanks
Hi,

I have a java program and running a web application on tomcat server (Windows/Linux/Solaris).

My problem is to start/stop the java program whenever the tomcat server start/stop.

Please help on this.
Saravanan.P
17 years ago
Hi,

It may be simple doubt,It makes sense for me.I want to know whether tomcat is application or web server as well as apache also?.


Thanks in Advance,
P.Saravanan
17 years ago
Thank Paul.POC means proof of concept.

To serialize a object.

it should have public constructor and getters/setters method for each property in the class right?.I do not know,correct me if i am wrong.

Thanks.
Saravanan.
17 years ago
Hi Everybody,


I need give POC to my team like,

I have to pass org.w3c.dom.Document from client and service method do some process and return org.w3c.dom.Node Object as return type in the WSDL.

Here,

1. I have to give Axis oriented web service for tomcat deployment
2. Then web logic server oriented web service ( using servicegen ant task ).

Please help me in this case like,

How do we make the WSDL to support XML Object.


Thanks,
Saravanan
17 years ago
Dear All,

I have used

Direct Web Remoting framework (DWR)

for AJax to do the functionality in client side itself.But the java script writing thousand of records in HTML tables with out refreshing the page.

My problem is How do i print the records like 10 by 10 using navigation like that.

Advance Thanks
Saravanan
hi Ulf Dittmer,

Could you please help on the above issue.

Thanks in Advance,
Saravanan.
hi,
i was able to get the xpath of the nodes.But it displays the value as zero for all the nodes.

This is the result i am getting.

path /C:/Documents/
Tag Name catalog
Tag Name journal
Tag Name article
Tag Name title
XPath //catalog[0]/journal[0]/article[0]/title[0]
Tag Name author
XPath //catalog[0]/journal[0]/article[0]/author[0]
XPath //catalog[0]/journal[0]/article[0]
XPath //catalog[0]/journal[0]
Tag Name books
Tag Name article
Tag Name title
XPath //catalog[0]/books[0]/article[0]/title[0]
Tag Name author
XPath //catalog[0]/books[0]/article[0]/author[0]
XPath //catalog[0]/books[0]/article[0]
XPath //catalog[0]/books[0]
Tag Name journal
Tag Name article
Tag Name title
XPath //catalog[0]/journal[0]/article[0]/title[0]
Tag Name author
XPath //catalog[0]/journal[0]/article[0]/author[0]
XPath //catalog[0]/journal[0]/article[0]
XPath //catalog[0]/journal[0]
Tag Name book
Tag Name article
Tag Name title
XPath //catalog[0]/book[0]/article[0]/title[0]
Tag Name author
XPath //catalog[0]/book[0]/article[0]/author[0]
XPath //catalog[0]/book[0]/article[0]
XPath //catalog[0]/book[0]
Tag Name journal
Tag Name article
Tag Name title
XPath //catalog[0]/journal[0]/article[0]/title[0]
Tag Name author
XPath //catalog[0]/journal[0]/article[0]/author[0]
XPath //catalog[0]/journal[0]/article[0]
XPath //catalog[0]/journal[0]
XPath //catalog[0]

The xml file used is:

<?xml version="1.0" encoding="utf-8"?>
<catalog>
<journal title="Oracle Magazine" publisher="Oracle Publishing" edition="July-August 2005">
<article section="Technology">
<title>Tuning Undo Tablespace</title>
<author>Kimberly Floss</author>
</article></journal>
<books title="Oracle Magazine" publisher="Oracle Publishing" edition="July-August 2005">
<article section="Developer">
<title>Using PHP 5 with Oracle XML DB</title>
<author>Yuli Vasiliev</author>
</article></books>
<journal title="Oracle Magazine" publisher="Oracle Publishing" edition="July-August 2005">
<article section="Developer">
<title>Using PHP 5 with Oracle XML DB</title>
<author>Yuli Vasiliev</author>
</article></journal>
<book title="Oracle Magazine" publisher="Oracle Publishing" edition="July-August 2005">
<article section="Developer">
<title>Using PHP 5 with Oracle XML DB</title>
<author>Yuli Vasiliev</author></article>
</book><journal title="Oracle Magazine" publisher="Oracle Publishing" edition="July-August 2005">
<article section="Developer">
<title>Using PHP 5 with Oracle XML DB</title>
<author>Yuli Vasiliev</author>
</article></journal></catalog>


Could you please help me on this.
Ulf Dittmer,

Its looking good,I think it may fit for my requirement.Let me try that.


Thanks a lot,
Saravanan.P