Ed Thompson

Ranch Hand
+ Follow
since Jan 20, 2006
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 Ed Thompson

You might find wsdl4j helpful for parsing the wsdl file to determine what fields you need to present the user with.
13 years ago
I am trying to define a web service request where the request message requires no parameters. The response message will return a string.

If I define a request message with no part:

I get a a BP2120 'non-unique message signatures' validation error when I have too methods that both use the empty request (even though they are name differently).

If I define an empty element in types and assign to both, same thing.

If I define a unique empty element for each

It generates code the expects an input object to be passed in:

Is there a way to write the wsdl that is WS-I compliant AND will not require the generated method to require an input message?

[ September 04, 2008: Message edited by: Ed Thompson ]
13 years ago
Found it - getLength() on the DataGram packet.

I knew it had to be simple!
Natish, how do I get the number of bytes received? If I knew that, my problem would be solved.
I create a UDP packet with a byte array of 1024 bytes. When I receive the message, I convert the byte array to a String using:

new String(b, 20, b.length - 20);

However, what I get is the expected String data padded on the right with nulls(?) out to the end of the 1024 bytes, instead of to the end of the byte array actually sent.

What is the correct/standard way to accomplish what I am trying to do?
If you look at the disassembled code (m1 is your second example, m2 your first):

There is a checkcast on the String generic (m2:36), but not on the Integer generic (between M1:24 and m1:29).
[ November 12, 2007: Message edited by: Ed Thompson ]
It doesn't look to me like it's behaving properly.

I suspect it might be testing "Hello" to determine if it's an instanceof String on behalf of println, and finding it such goes no further.

When it tests 100 and finds it's not an instance of String (for println), it next test to see if its an instance of the correct class based on the generic, and fails that test, throwing the exception.

Just conjecture though. I do not think it is behaving correctly.

Interestingly, both of these work:

[ November 12, 2007: Message edited by: Ed Thompson ]
I think you are confusing the JSP, which gets compiled into a servlet and runs on the server to generate a page, with the page the JSP generates, which can only run JavaScript.
[ November 01, 2007: Message edited by: Ed Thompson ]
14 years ago
Cameron, checking out your tutorial now.

On a separate note, what software do you use to generate those?

YES! After 3 days, I finally got it to work! What a pain!!! (The IBM doc is scattered all over the place. Never seems to be a place for one stop shopping)

I had to bind the reference in the web.xml file. Under RAD7 that meant:

1) From the deployment descriptor references tab, add a WebSphere binding of jms/MyConnectionFactory.

2) At first blush, this only added an id to what I had before:

However, buried in ibm-web-bnd.xmi is where the dots get connected:

In the code I had to change the lookups from "jms/MyConnectionFactoryRef" to "jms/MyConnectionFactory". I also had to change the code in the servlet from looking up a Destination to looking up the queue.

The outstanding question? Did I break a best practice by removing 'Ref' and Destination, or is this a necessity of Writing to the queue from a servlet instead of an EJB?

Also, this was not real intuitive - how would I have known to do this? How would i have done this manually had I not been working in RAD?

I am looking for some help getting JMS working under WebSphere.
Using RAD and WebSphere

I started with the example at http://www.ibm.com/developerworks/websphere/library/techarticles/0504_barcia/0504_barcia.html .
I was able to get it up and running, and ran the test case in the article.

However, when I tried to use the 'Send JMS Message' facility of the Universal test Tool, I go:

com.ibm.ws.sib.api.jms.impl.JmsManagedConnectionFactoryImpl incompatible with org.omg.CORBA.portable.ObjectImpl

Rather than spin my wheels, I jumped to trying to write a message to the Queue from a servlet. I copied the code from MessageProducerBean into a servlet. The code throws an exception when trying to grab the connection factory:

Name comp/env/jms not found in context "java:".

The JNDI reference exists in the global context, but not in the 'java:' context:

I have added a reference to web.xml:

Not sure where to look next.


[ October 30, 2007: Message edited by: Ed Thompson ]
I tried to make it work that way, and I am pretty sure there is a way to do it, but I couldn't find the right combination of quotes and brackets in the few minutes I spent on this.

But is is somehow an issue of the right combination of quotes and brackets in the UNIX shell script.

(Brackets may only be an issue when calling shell script methods, I can't remember)
14 years ago
Another interpretation - your utility is submitting a job request that another process is executing. In this case, the utility is done when the job is submitted. In this scenario, you would need some way of interfacing with the process that actually executes the request, not the one that submits it.

Again, this is usually possible through some sort off shell/batch script. Whether you include the submit/monitor in a single resuest to a script, or break them up is up to you.
14 years ago
Without more details I am guessing, but I suspect that the utility you are calling (not a Java program?) is forking a process to do the real work, then terminating the process you started to get the ball rolling.

Without knowing more about the utility, you may be able to do something with wrapping the utility call in a shell script, and controlling true process termination with the termination of the utility call within the shell script.

That is, if you can write the shell script in such a way that it does not terminate until your processing is complete, you could then call the shell script from Java, and processing should proceed as you desire.
14 years ago
The issue is not with Java, but with how shell scripts resolve variables.

The following works:

14 years ago