Steve Buck

Ranch Hand
+ Follow
since Nov 23, 2004
Merit badge: grant badges
For More
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 Steve Buck

Wow you saved my day

19 years ago
I've extracted some HTML data into a string. I now want to remove all <sup> tags and the data between them.

For example:
abc<sup>(<a href="#junk" title="See cross-reference AM">AM</a> </sup>def

should become:

I've tried to use replaceAll but I'm not very knowledgeable with regex patterns. So far I've tried "<sup>.*</sup>" but that does not work. Why? Because I have many <sup> tags in the data extracted and it matches the opening with the first one and the closing with the last occurrence. All data between gets erased

Is there any way to suggest that the inner pattern (currently .*) may be anything BUT </sup> ? That would work for me (it would then match the very first closing tag). I'm not sure how to add such an exclusion.

19 years ago
Thanks Stan James. I'll look into those more (I've used URL lightly with JAX-RPC and whatnot).

19 years ago
Basically I want to find a way to create an input character stream from the HTML kicked back from an HTTP request.

So I can select a URL, the code would then be able to grab the HTML and turn it to an input stream.

I'm not looking for anything to parse it--thats all done by me programmatically.

I just need to -get- the data somehow.

I have no idea what to look into. I've never touched this sort of stuff in Java (or any language heh)
19 years ago
Thanks for the link.

Unfortunately the ant task "autotype" appears to only work with the ant tool distributed with Weblogic. It comes up (Weblogic) anywhere I've researched the autotype task.

My ant (from the Apache Group site) does not support this task and nor does the task list (both the ones available) on the Ant site makes mention of it :'(

I'll try a manual way of handling it. If all else fails I'm going back to String LOL
[ March 29, 2005: Message edited by: Steve Buck ]
19 years ago
I am trying to write a dynamic proxy client for a JAX-RPC web service.

The particular method returns an array of complex type defined by me.

The problem is that the dynamic proxy client has problems deserializing the returned array of complex type.

It claims: deserialization error: no deserializer is registered for ({namespace}ComplexType, {1})

Must I write special serializer and deserializer for this complex type? How can I accomplish this? And how must I register it and so forth.

I've googled for a while and couldn't find any helpful articles on this :/ I found a few forum posts on the sun java forums but nothing was helpful at all in how to find a solution. I'm new to the whole concept of web services so just suggesting to write and register deserializer makes no sense to me

If worst comes to worst I will just rewrite the web service to return arrays of String (the clients just paste the data out, nothing big so I can have one large string with newlines in it or whatever). I would not like to do this however and would prefer if I could use complex types with JAX-RPC somehow (preferably nothing too complicated).

Please help if you can, I'm going nutty!

PS I'm using JWSDP and Tomcat 5.0 with JWSDP I believe. I'd like to avoid using "AXIS" if that is proprietary (not sure even what the heck it is )
[ March 28, 2005: Message edited by: Steve Buck ]
19 years ago
Hi all,

Heres a rundown what I'm doing. Wrote a web service and now writing a swing client for it. Inside the swing client I want the user to be able to specify the port name, service name, wsdl location and namespace. I grab these values with an event handler in the form of Strings.

While these values may change, the actual method signatures behind the endpoint will remain consistent

When creating a proxy in the client, I need to use service.getPort(...) method to retrieve a proxy (or generated stub). This method call requires the java.lang.Class for the service endpoint interface (such as FooIF.class).

I'm not sure how I can pass this. I've heard about class loaders and the using the java.lang.Class methods ... am I headed in the right direction?

Then I'd like to cast it and call a method preferably something like
String results = (class cast somehow)proxy.myMethod();

(This is moreso a Java problem then web services so I figured to put it here)
[ March 25, 2005: Message edited by: Steve Buck ]
19 years ago

Originally posted by Jean-Louis Marechaux:

maybe you should also consider compressing the data you send.
It's amazing to see how thin a soap message can be once compressed

and even if it is not the question here, maybe web services is not the good technology to transfert huge volumes :roll:

[ February 02, 2005: Message edited by: Jean-Louis Marechaux ]

It isn't the ideal technology, of course not! The problem is that I'd like to start using XML Web Services so that any other person who wants to take advantage of my system can easily do just that...

The alternative, of course, is to use an external measure for the data exchange that is more efficient and correct, but still provide XML & open functionality on the front end of things (where the client and server communicate... getUsers(), doThis() etc). That would mean that only my systems could communicate amongst one another for data exchange, but others could still use and extract data through the other means on the front end.

Tough choice!

As far as compression methods--yes I have been reading up on these a fair bit. I'm confident that when transfering thousands of records in XML the patterns will be so significant (most elements will be the same) that the compression will be really good. I would prototype and benchmark but I'm so limited at this point (in terms of J2EE web service programming knowledge) that its difficult.

19 years ago
Many people dislike using EJBs (which entity beans are a subset of) because they are costly in terms of resources (you will find this many places; I don't have exact numbers but you can easily google for some)

Hibernate is a "lightweight" framework that seems to fulfill the most useful features of EJBs (persistence). It is also much faster because its lightweight.

Your best bet for a comprehensive coverage is to google for some articles.

Personally I stick with EJBs because thats what is in the spec. You can rest assured that if you program to EJB spec, your app will run properly across all application servers (but they must support that EJB spec eg 2.0, 2.1, 3.0 of course).

EJB 3.0 will be more "lightweight" and more like Hibernate from what I've read. It would be advisable to google for EJB 3.0, too.

I've decided that I will stick to EJB because it provides other features I need (remotability, transaction, security, timer services) in addition to being the spec.

It really depends on what sort of functionality and compliance you are looking for. Both are widely used.
[ February 02, 2005: Message edited by: Steve Buck ]
Specify the time you would like the first occurence with firstDate and then if you want it everyday at that time, use 24 hours in milliseconds (86400000 I think?) for the timeoutInterval.

You should have a look at the article, though. I'm quite tired so take what I say with a few handfuls of salt

This is a good little article that I learned about J2EE timers from.

When you say you want the user to enter a time--do you mean for the report generation/scheduling or the actual EJB timeout for method calls?

If its the former, you can easily do it with this:
createTimer(Date firstDate, long timeoutInterval, Serializable info)

Where timeoutInterval is the milliseconds between calls and firstDate is the initial occurence. When the timeoutInterval is reached, the container will call the ejbTimeout method for you automatically and do your business logic (report generation and scheduling).
Thanks William!

Basically I'm just attempting to duplicate thousands of records at one site to another. I can't just do database-to-database either as I need to apply some business rules for that site (where the Java comes in) and the databases will likely not even be the same product.

Basically anything I do it has to be contained with J2EE :/ Unfortunate because using something outside the container would be easier and faster--but I want it to be completely contained inside.

There won't be any reassembly of the XML responses needed on the other end--it can just apply business rules to those records and insert the valid ones in the database as it completes receiving each XML web service response.

I just need to know if I can really count on doing 10MB chunk transfers or not (can both sides of the equation handle it)

I realize there are other more preferably methods (believe me ) but I just need some sort of "validation" from an expert on whether or not this is a good idea (the overhead of xml and so forth aside)

[ January 31, 2005: Message edited by: Steve Buck ]
19 years ago
How many pieces/responses would you suggest I break up 1GB of XML into?

I want to keep the overhead of breaking it up to a minimal, is there any way to suggest how much more it would cost to initiate an HTTPS request between the client and server? Maybe 10 kilobytes?

I was thinking maybe break it up into 10MB chunks. The extra overhead for that would be pretty minimal, right? (I mean as far as the client and server communication goes for initiating, setting up and tearing down HTTPS etc)

Thanks again.
19 years ago

Originally posted by Brian Tinnel:
Are you asking if it is legal for an EJB to call a Web Service? If so, then the answer is yes.

Precisely what I am asking. I'd like an EJB method to call a web service and be able to use the XML returned for some business logic.

I know EJB has lots of limitations so if it couldn't do that I wouldn't be surprised. Thats why I had to ask

I realized more recently the data being transferred will be completley plaintext. Therefore I won't even need to change the encoding.

There will be a little overhead breaking it up into separate transmissions but thats no insignificant amount IMO. So this is probably how I would do it, too.

The problem now lies in whether or not an EJB method can legally call on a web service method (such as described in my other thread). If it is allowable under the EJB 2.1 and the J2EE container spec then I'm all for it

I want to setup a Timer Service for an EJB on site A to callback a method eg getUpdates(). getUpdates() will have in its code the call to an XML web service at site B. Site A then gets the XML response, applies some business logic and then pops in the remaining data into the database using JDBC.

My only problem now exists whether if its allowed or not. I have no experience with web services to this point and I don't know if it calls upon any (which EJB container prohibits?) or how exactly it works with the parsers and so forth.

If someone could tell me concretely whether it can be done (and not break the spec) or not I'd appreciate it

thanks again.
[ January 26, 2005: Message edited by: Steve Buck ]