Kel Walker

Greenhorn
+ Follow
since Apr 04, 2002
Merit badge: grant badges
For More
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kel Walker

Thank you for your help.
21 years ago
I am investigating the capabilities of Apache Axis, 1.0rc1. Unfortunately I have fallen flat on my face at the very first fence.
The user guide gives an example of consuming web services with Axis: samples/userguide/example1/TestClient.java. I have compiled this and run it.
I get:
- Mapping Exception to AxisFault
AxisFault
faultCode: {http://xml.apache.org/axis/}Server.userException
faultString: java.net.ConnectException: Connection timed out: connect
faultActor: null
faultDetail:
stackTrace: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:295)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:161)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148)
at java.net.Socket.connect(Socket.java:425)
at java.net.Socket.connect(Socket.java:375)
at java.net.Socket.<init>(Socket.java:290)
at java.net.Socket.<init>(Socket.java:118)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:130)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:173)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:116)
at org.apache.axis.strategies.Invjava.net.ConnectException: Connection timed out: connect
ocationStrategy.visit(InvocationStrategy.java:71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:153)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:123)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:181)
at org.apache.axis.client.Call.invokeEngine(Call.java:2084)
at org.apache.axis.client.Call.invoke(Call.java:2073)
at org.apache.axis.client.Call.invoke(Call.java:1842)
at org.apache.axis.client.Call.invoke(Call.java:1768)
at org.apache.axis.client.Call.invoke(Call.java:1306)

Can somebody PLEASE help!!!
21 years ago
Cache the id value sequence. Something along the lines of:
List pictureId = (new ArrayList() );
// Add Ids to list from ResultSet.
pictureId.add("id1");
pictureId.add("id2");
pictureId.add("id3"); // Whatever type your id is?
// etc.
int pictureIdIndex = 0; // Lists are zero indexed.
// if previous was pressed.
pictureIdIndex -= 1;
if (pictureIdIndex < 0) pictureIdIndex = 0;
// if next was pressed.
pictureIdIndex += 1;
if (pictureIdIndex > (pictureId.size() - 1) ) {
pictureIdIndex = (pictureId.size() - 1);
}
// To get the current id.
String currentId = (String)pictureId.get(pictureIdIndex);
Haven't compiled or tested this, but you get the idea.
Sorry folks,
I figured it out. Although * is the MS Access wildcard the jdbc driver expects % not *.
Is it just me or does the like operator not work with the sun.jdbc.odbc.JdbcOdbcDriver.
String sql = "SELECT * FROM test WHERE name like '*wal*' order by name;";
When this is executed in my java code no results are returned. When executed directly within Access the correct results are displayed.
Anyone else experienced the same problem. Does anyone have a like operation that works via jdbc?
Thanks.
Hey,
William and Kyle. Thank you for your advise.
It was the HTTP proxy which was giving me the headache.
For those who are interested, I have found a workaround. It is possible to set the proxy programmatically. Not sure this is the best way to go about things but it does work.
System.getProperties().put("proxySet","true");
System.getProperties().put("proxyHost","myProxy");
System.getProperties().put("proxyPort","myPort");
I also noticed that the xrpcc tool has the option -Xhttpproxy:host ort (specifies an HTTP proxy server). I have tried this but not sure exactly what it does (doesn't seem to do anything). Does anyone know what this option does.
p.s. William, just bought your exam cram book. Excellent. Good work.
21 years ago
Please help. I'm stressed and depressed.
I am trying to write a web service client using jax-rpc.
I downloaded Java Web Services Development Pack from Sun and Java Web Services Tutorial.
I am now trying to develop my first ever Web Service client.
The web service I wish to use is hosted by ServiceObjects. See http://www.serviceobjects.com/products/dots_email.asp .
I have run the WSDL document at http://ws.serviceobjects.net/ev/EmailValidate.asmx?WSDL through the xrpcc.bat tool.
I received 2 warnings :
warning: ignoring port "EmailValidateHttpGet": no SOAP address specified.
warning: ignoring port "EmailValidateHttpPost": no SOAP address specified.
I ignored these because I do not know what they mean. Ha ha.
I then wrote the client as so:
package com.walker.util.webservice;
import java.rmi.Remote;
import java.rmi.RemoteException;
import com.walker.util.webservice.emailvalidation.artifact.*; // Xrpcc generated artifacts.
public class EmailValidationClient {

public static void main(String[] args) {
java.lang.String email = "walkerk@farnell.com";
java.lang.String licenseKey = "0"; // Use a license key of 0 for testing.
try {
EmailValidateSoap stub = (new EmailValidate_Impl().getEmailValidateSoap() );
Email mail = stub.validateEmail(email, licenseKey);
System.out.println(mail.getDNSCheck() );
} catch (java.lang.Throwable trouble) {
System.out.println(trouble);
trouble.printStackTrace(System.out);
}
}
}
When I ran it I got :
java.rmi.RemoteException: HTTP transport error: java.net.ConnectException: Connection timed out: connect; nested exception is:
HTTP transport error: java.net.ConnectException: Connection timed out: connect
java.rmi.RemoteException: HTTP transport error: java.net.ConnectException: Connection timed out: connect; nested exception is:
HTTP transport error: java.net.ConnectException: Connection timed out: connect
at com.walker.util.webservice.emailvalidation.artifact.EmailValidateSoap_Stub.validateEmail(EmailValidateSoap_Stub.java:76)
at com.walker.util.webservice.EmailValidationClient.main(EmailValidationClient.java:46)
Caused by: HTTP transport error: java.net.ConnectException: Connection timed out: connect
at com.sun.xml.rpc.client.http.HttpClientTransport.invoke(HttpClientTransport.java:189)
at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:73)
at com.walker.util.webservice.emailvalidation.artifact.EmailValidateSoap_Stub.validateEmail(EmailValidateSoap_Stub.java:60)
... 1 more
I am behind a firewall and use a proxy to connect to the internet. Not sure if that is the problem.
Please help, this is taking years off my life.
I appreciate any suggestions.
21 years ago
No worries. I checked the javadocs.
Problem solved. Thank you.
21 years ago
Hey Roy Ben Ami,
That was the answer I was looking for. I knew there was a way.
Could you give me example syntax.
Thanks again.
21 years ago
Does that mean that there is no way to generate a new request to the jsp from the servlet?
There are quite a lot of unwanted parameters in the request object that I would have to test for and ignore. This could make my jsp a bit messy.
21 years ago
Experts,
I have a jsp myjsp.jsp.
The jsp has a HTML form which submits/posts to a servlet.
The servlet processes the request and then forwards to the same jsp myjsp.jsp like so :
RequestDispatcher rd =
getServletContext().getRequestDispatcher("/myjsp.jsp");
rd.forward(request, response);
My problem is when returning from the servlet I want the jsp to act as though it is receiving a completely new request.
Because there are parameters still in the request object when it gets forwarded myjsp.jsp is not behaving correctly.
Is there any way I can destroy the old request object once processed and force a new one. I am looking for behaviour similar to <jsp:forward ...>.
Please share solutions/workarounds.
Thank you.
21 years ago
I have a jsp with a html form that posts directly to a servlet. The servlet processes the data, and will then forward to a second jsp to display the results.
I want the results jsp to be opened in a new browser window. Can someone please advise the best way to do this?
Thank you.
21 years ago
This may or may not help.
This is supported in JDBC 3.0.
See the section named 'auto-generated keys' in this article.
Getting upto date with JDBC
Thanks Ryan,
I will read it ALL. Chances are I will sit the 1.3 exam anyway.
Good luck with your exam. Post your results on javaranch.
Studying for the programmer exam is HARD enough, without the confussion surrounding its transition to the new 1.4 format.