faisal hameed

Ranch Hand
+ Follow
since Jan 19, 2009
pakistan
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by faisal hameed

Here is complete code to compute strength of hand whick I learn from an online course.
6 years ago
You have to set these two setting before calling web service from your client.


certificate.jks file is created from the certificate.cer file provided by your WebService provider.

If the problem persists then might be you are using the incorrect certificate.

Also try it with enabling debug option and see what is happening on console.

6 years ago
Please explain a little bit more.
How do you consuming web services?
Does the error is shown during creating stub?
6 years ago
Hi all,
I am using jasper reports in java.
I want to get HTML from jasper report and set HTML in JEditorPane.
How can i do that?
One way can be
Export report in HTML file then read that HTML file as a String and set it in JEditorPane.
Is there another solution?
7 years ago
Thanks for reply.
I have tried this code on 10 different PC's on same environment but it creates problem on only 2,3 PC's and hangs.
If it is my swing code issu then why it is running on some PC's.
I have also tried to make connection in differenct thread but same problem.
7 years ago
Hi
I am using oracle 11g and jdk 1.6 and ojdbc6 driver.
I have created GUI in netbeans GUI builder with DND.
I want to make a db connection from JButton actionPerformed method but it hangs on DriverManager.getConnection().
what is wrong with the following code.I have called this method from actionPerformed DataBase.createConnection1().


7 years ago
Hi Rnchers
I am consuming a web service in java with Axis2 with ADB data binding.Now i am getting the result as OMElement.
Please tell me how to get data from response.
Which is the best way to get data from xml.


The OMElement returning the following xml result.

<?xml version="1.0" encoding="UTF-8"?>
<ns1:GetMarginsContractResponse xmlns:ns1="http://tempuri.org/">
<ns1:GetMarginsContractResult>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="NewDataSet">
<xs:element name="NewDataSet" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="COM_CODE" type="xs:string" minOccurs="0" />
<xs:element name="CON_CODE" type="xs:string" minOccurs="0" />
<xs:element name="CON_NAME" type="xs:string" minOccurs="0" />
<xs:element name="MAR_TYPE" type="xs:decimal" minOccurs="0" />
<xs:element name="MAR_CODE" type="xs:string" minOccurs="0" />
<xs:element name="MAR_VAL" type="xs:decimal" minOccurs="0" />
<xs:element name="MAR_START" type="xs:dateTime" minOccurs="0" />
<xs:element name="MAR_END" type="xs:dateTime" minOccurs="0" />
<xs:element name="MODEID" type="xs:string" minOccurs="0" />
<xs:element name="MAINT_MARGIN" type="xs:decimal" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<NewDataSet>
<Table diffgr:id="Table1" msdata:rowOrder="0">
<COM_CODE>RI6</COM_CODE>
<CON_CODE>RICEIRRI6</CON_CODE>
<CON_NAME>NOV 08</CON_NAME>
<MAR_TYPE>3</MAR_TYPE>
<MAR_CODE>SM</MAR_CODE>
<MAR_VAL>0</MAR_VAL>
<MAR_START>2008-03-07T00:00:00.0000000+05:00</MAR_START>
<MAR_END>2008-03-17T00:00:00.0000000+05:00</MAR_END>
<MODEID>ABSAMT</MODEID>
</Table>
<Table diffgr:id="Table2" msdata:rowOrder="1">
<COM_CODE>GO</COM_CODE>
<CON_CODE>GOLD</CON_CODE>
<CON_NAME>MAY 08</CON_NAME>
<MAR_TYPE>2</MAR_TYPE>
<MAR_CODE>DM</MAR_CODE>
<MAR_VAL>784.50</MAR_VAL>
<MAR_START>2008-05-20T00:00:00.0000000+05:00</MAR_START>
<MAR_END>2008-05-23T00:00:00.0000000+05:00</MAR_END>
<MODEID>ABSAMT</MODEID>
<MAINT_MARGIN>0</MAINT_MARGIN>
</Table>
<Table diffgr:id="Table1015" msdata:rowOrder="1014">
<COM_CODE>SL500</COM_CODE>
<CON_CODE>SL500OZ</CON_CODE>
<CON_NAME>JY11</CON_NAME>
<MAR_TYPE>1</MAR_TYPE>
<MAR_CODE>IM</MAR_CODE>
<MAR_VAL>148900.00</MAR_VAL>
<MAR_START>2011-02-25T00:00:00.0000000+05:00</MAR_START>
<MAR_END>2011-06-28T00:00:00.0000000+05:00</MAR_END>
<MODEID>ABSAMT</MODEID>
<MAINT_MARGIN>100</MAINT_MARGIN>
</Table>
</NewDataSet>
</diffgr:diffgram>
</ns1:GetMarginsContractResult>
</ns1:GetMarginsContractResponse>
7 years ago
Thanks for your reply.
I already read this FAQ link.
Now i can build Web Service in java on eclipse and also i can consume those web services.
Now i am getting the following exception while trying to access external WSDL file from Web Service Explorer of eclipse.
I have installed the SSL certificate in my web browser provided by owner of web services.And i can view this file in browser but unable to access in eclipse web service explorer.

IWAB0379E Unable to open https://trade.ncel.pk/ncel.webservices/wstradedata.asmx?WSDL.
IWAB0135E An unexpected error has occurred.
WSDLException
WSDLException: faultCode=OTHER_ERROR: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target


and sometimes i get this exception
Unable to tunnel through the proxy.

Please tell me what should i do?
7 years ago
I want to consume a web service (written in .Net) using java.
I have given the uri of web service i.e. https://myProject/WebServices/WSClientsInfo.asmx
and method DS_ClientsInfo GetClientsInformation(string[] paramIds, DateTime date).
This method is returning a XML file.
My problem is that.
Can i use this web service with given information?if No what information is needed to use it.
Please give me sample code to use this web service and how to pass parameters to web service.
Or give me some useful related links.
Thanks in advance.
7 years ago
Thanks for replying....
As you can see in the stack trace i am using SSL Sockets to create connection.
It is a simple java program.I am running server and client on the same machine.
Please give me some hints,how can i debug it ?
I am connecting and disconnecting client continuosly.After 5 or 6 time this exception is occured.
Hi rancher.
I am getting an exception on client side during login.Most of the time i connect successfully but some time this exception is occured.
Please tell me what should i do?

javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException: Connection closed by remote host
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkWrite(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
at java.io.ObjectOutputStream$BlockDataOutputStream.drain(Unknown Source)
at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(Unknown Source)
at java.io.ObjectOutputStream.writeNonProxyDesc(Unknown Source)
at java.io.ObjectOutputStream.writeClassDesc(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeFatalException(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at project.io.MessageOutputStream.writeObject(MessageOutputStream.java:74)
at project.network.TCPLink.writeData(TCPLink.java:204)
at project.MainFrame.sendRefDataRequest(MainFrame.java:1968)
at project.MainFrame.initialize(MainFrame.java:522)
at project.MainFrame.<init>(MainFrame.java:274)
at project.ApplicationMain.<init>(ApplicationMain.java:79)
at project.ApplicationMain.main(ApplicationMain.java:140)
Caused by: javax.net.ssl.SSLException: java.net.SocketException: Connection closed by remote host
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
at java.io.ObjectOutputStream$BlockDataOutputStream.drain(Unknown Source)
at java.io.ObjectOutputStream$BlockDataOutputStream.write(Unknown Source)
at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
... 8 more
Caused by: java.net.SocketException: Connection closed by remote host
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkWrite(Unknown Source)
... 15 more
Thanks for your response.
But how i can modify it so that it can accept only one dot(.) anywhere.
8 years ago
I want to match the decimal values by using regex matcher of java.How can i do that?

Examples.

3
3.3
34.009
0.34

but not
.3
8 years ago
Hi Ranchers..
I want to export my eclipse product for windows from Linux. How i can do that?
I have another problem.
There are two views(Security , News).When i start application my Security view is focused.
Tool bar items of News View are shown on Security view left side.
When i click on News view ,tool bar items disappear.
why they are shown first time?
I am using (java -server -classpath "lib/ts.jar:lib/ojdbc14.jar:lib/mail.jar:lib/activation.jar") this line in a file(Server.sh).
These jar files are in my lib folder and Server.sh and lib folder in same folder.
By executing Server.sh from terminal I am getting this exception.

Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc10 in java.library.path
Now what i have to do?