sriram varadharajan

Greenhorn
+ Follow
since Jan 03, 2007
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 sriram varadharajan

// here is my singleton class.



//first and only instance of singleton /


//I am thinking this will be same instance as the first one.
9 years ago
i am right now reading SOA using JAX-WS by Mark Hansen. i Picked this book because this deals with JAX-WS instead of JAX-RPC. I feel it is good but the only problem i have when i try the examples some of them do not work. It is vey hard to gert answers as you have no way to reach the author.

thanks
10 years ago
I am reading the book SOA using JWS by Mark Hansen and trying out the examples . i am stuck with the example that teaches how to post xml to a REST based webservice without using JAX-WS.

Using maven i have deployed the webservice and i am trying to post an XML file to it using the client.
This is the client code that is trying to connect to service . it is basic HTTP connection and does not involve the JAX-WS API

public class PostCustomerHistory {

//! <example xn="PostCustomerHistory_Client_HTTP">
//! <c>chap03</c>rest-post
public static void main(String[] args) throws Exception {
if (args.length != 2) {
System.err.println
("Usage: java PostCustomerHistory <XML file name> "
+ "<Web Service URL>");
System.exit(1);
}
FileInputStream in = new FileInputStream(args[0]);
URL url = new URL(args[1]);
HttpURLConnection con =
(HttpURLConnection) url.openConnection();
con.setDoOutput(true);
con.setRequestMethod("POST");
System.out.println("Before connectionggggggg"+args[1]);
con.connect();

OutputStream out = con.getOutputStream();

// write the XML doc from file to the HTTP connection
byte[] b = new byte[1024]; // 1K buffer
int result = in.read(b);
while (result != -1) {
out.write(b,0,result);
result = in.read(b);
}
System.out.println("After connectionggggggg");
out.close();
in.close();
// write HTTP response to console
System.out.println(con.getResponseCode() +
" srirammmmmmmmmmmmmmm" + con.getResponseMessage());
}
//! </example>
}

the exception i get is

run-servlet:
[java] Before connectionggggggghttp://localhost:8080/chap03-restpost-endpoi
nt-servlet-1.0/CustomerHistory?SourceSystem=OMS
[java] After connectionggggggg
[java] 500 srirammmmmmmmmmmmmmmThe system cannot find the path specified
[INFO] Executed tasks
[INFO] [install:install {execution: default-install}]
[INFO] Installing C:\webservicesCodeSamples\chap03\rest-post\client-http\target\
chap03-restpost-client-http-1.0.jar to C:\Documents and Settings\svaradharajan\.
m2\repository\soabook\chap03-restpost-client-http\1.0\chap03-restpost-client-htt
p-1.0.jar


please let me know where i am going wrong.Both the client and server are in the same machine.


thanks
10 years ago
don,
I am reading this book trying out the examples . i am stuck with the example that teaches how to post xml to a REST based webservice without using JAX-WS.
please let me know if you have tried running examples and then i will post my question.

thanks
10 years ago
i agree to what karthik says but to me it looks like you are setting it in the request object when the page is rendered . if this is a form submit it should definitely be available in the action class . i would ensure you do a form submit . if it still a problem put a hidden field on the page and store the value during load . in that way i think you can use request.getParameter('hidden variable name').

10 years ago
thnx rob.i wuld stay in touch thru the forum.

thnx.
10 years ago
hello rob,
thank you very much . i am dftly going to change my code the way you have put it here . just to be sure your code means the following
a)only one instance of vehicleCoverageMarshallCreator will be there for my JVM
b)There can be many instances of vehicleCoverageMarshall depending how many calls to create () method is being made .
Please let me know if i am correct in what i am saying .
If you dont mind can i have your email Id.
Thanks again !!!
10 years ago
All i am trying is find out should factory classes is better off when written as singletons.




OR

10 years ago
I have a voucher for Java 5.0 Upgrade exam. The cost of the exam is 100$.
I am willing to give the voucher for lesser amount also.I had purchased the
voucher by mistake intending to purchase SCJP for programmer.

If interested please call me @ 201-724-3363.

Thanks
Sriram.