Miklos Szeles

Ranch Hand
+ Follow
since Oct 21, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Miklos Szeles

Unfortunately that did not help.
I don't know what would be the "correct" solution - I hope somebody will answer it in the future - but I found a workaround which works:
After generating the source files, I've replaced all
http://schemas.xmlsoap.org/soap/envelope
with
http://www.w3.org/2003/05/soap-envelope

That solves the issue.
12 years ago
Further analyzing the problem I found the source of the problem (but I still can't find the solution).

It looks like the camera can send SOAP 1.2 messages, in case if the request is SOAP 1.2(I've used the test tool to check this).
Despite of the fact that the code generates a correct link for the Envelop namespace at the beginning:


It also contains the SOAP 1.1 Envelop namespace URL:

In case I send a message without the second envelop namespace, the camera response in SOAP 1.2 format.

So the problem is reduced back to the following:
Why the generated code do this? How can I convince wsimport to generate the correct Envelop?
I use the -extension with wsimport.>
12 years ago
Are you sure? For me it looks like the camera has no problem with this, since it sends the answer. The Java code generates this exception when processing the answer. According to the comment read on the ONVIF forum:

Generally the ONVIF working groups and Technical Committee take utmost care to ensure interoperability within the same version set by the namespace. So you can safely use the latest wsdl files for your implementation. Newer functionality is defined optional and bound to capabilities so that a client can easily find out whether a device supports it.


So based on this I should be able to use the latest wsdls only.

UPDATE:
I've downloaded and used the old WSDL files, but I receive the same error message.
12 years ago
Thanks to Ivan's and Ido's advices I was able to authenticate the user and execute different calls from the device management service. So thank you very much for that.
I've started to experiment with the Media service but I wasn't able to get it work.
I'm instantiating the service with the following code:

I also instantiate a DeviceService to get the date and time for the authentication. Using that information I create a SecurityHandler and "attach" it to the service according to the previous posts.
This works nicely for the Device calls, but whenever I call media.getProfiles() I receive the following exception:


Using wireshark I can even see the answer was sent by the camera (I've pasted the request and the response at the and of my post).
I tried to google for the exception but I haven't found the solution yet. What can be the problem?

The outgoing message is :


The response is:
12 years ago
Hi Jason,
I suspended working on this issue, so I made no further progress regarding this.
Best regards,
Miklós
12 years ago
Thanks. I did not want to modify the generated classes, I just thought that maybe it is possible to add the required security part to the messages.
Does this mean that it is not possible to make UsernameToken authentication only with the JDK 1.6 built in capabilities, but I have to use a 3rd party solution for this like the mentioned Metro or Apache Axis2 or ...?
13 years ago
Thanks Ivan. Actually I found the answer for my problem in one of your posts. So the solution is to use the default constructor for the service and change the endpoint

I think the reason why there is no service in the wsdl file because that site does not offer any service. It is a standard for IP cameras, so the cameras itself will offer the service not this site. Is this makes sense?

I've run into another issue unfortunately. I can make calls which requires no authentication, but I don't know how can I insert UsernameToken authentication (what is required here) into the generated classes. Any idea on that issue?
Thanks.
13 years ago
Hi,
I'm trying to generate the client code of a web service based on a wsdl file. This web service is used for communicating with IP cameras. The WSDL file is available here:
http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl

My first problem is that wsimport says that the wsdl file does not contain any services. To solve this problem, I've downloaded the wsdl file and added the following lines:

After this wsimport says the following:

So I used -extension and I was able to generate the source files.
Is this okay that I use a "dummy" service location just for generating the source codes?
Is it okay to use the -extension option, or should I define a service differently in the wsdl?

Next problem occurs when I would like to use the generated code. Actually I don't really know how to use it. I have a generated DeviceService class, so I try to instantiate it:

In case I use the wsdl location from the internet, then I get an error that the wsdl does not contain a service definition, so I try to use the modified wsdl file

In that case I receive the following error:

So I'm stuck at this point. Any idea what should I do differently to make this thing work?
I also don't really understand why do I have to specify the wsdl url again, since I generated the code from that wsdl.
Thanks in advance.

13 years ago
Thanks for your answer Darryl.
I made a small test program for the case and I found that it works fine. I compared the stack traces and at last I found that the only difference is that we use a custom EventQueue in our application. And the problem was there. For some unknown reason somebody put a try catch block in the dispatchEvent method which swallowed the NullPointerException without any log.
14 years ago
Hi,

I found a really annoying bug today in our application. It was a NullPointerException in a table cell renderer. The visible effect of the bug was that some component was only partially visible or not visible at all and the component didn't refreshed itself(only when I dragged the window off the screen and then back).
I've spent more than an hour by commenting out and back lines from the code to find that the NullPointerException in the cell renderer caused the bug. At this time I was lucky, since I was able to locate the bug, but I still had to spend more than an hour with it. Usually Swing prints stack trace on the console, when an exception occures, but not in this case. Can anybody tell me why? Is there a good solution to find these bugs somehow?
I was searching a little bit, and I've found the following code, but it didn't work for this case.


Thanks in advance
14 years ago
Thanks Rob, that works really well. It looks like that your solution also solved problem 6 and it also pointed me to another issue. Whenever a cell is finished editing it returns to rendering mode which is okay in case we changed to another component but not correct when the component keeps the focus. So I think at this point I should prevent ENTER key to finish editing. Is that the advised way to achieve behavior similar to normal textfield?

15 years ago
Hi,

I would like to display(and allow edit) lines of data in a table which not looks like as a table but more likely looks like as if the cells were normal textfields, checkboxes, comboboxes. I can start from the ground and build a custom component which creates header and layout the components as if it were a table(but I use a hierarchical table which extends jtable so in that case I would have to implement some table hierarchy handling also). First I thought that's the slow/bad way but I'm not so sure at the moment. The other more obvious solution would be to use a table and modify it's behavior to achieve the result. I've spent several hours to achieve this but I still have problems what I wasn't able to solve.
I turned off horizontal and vertical lines and added intercell spacing so the components not look like as a table anymore. This was the easy part. I think I need the following things to achieve what I want:
1. Make a custom renderer for JTextField which uses a JTextField as a renderer, and displays the same border as the normal JTextField
2. Create a cell editor which uses JTextField and displays the same border as a normal cell editor(even if it is selected).
3. Select textfield's content on becoming selected
4. Automatically start editing a cell when become selected(mouse, keyboard)
5. Open combobox's dropdown with space and down arrow

I managed to do 1-3 but I wasn't able to solve 4 and 5. Can anybody help with that?
Thanks in advance.
15 years ago
I think one bad thing in your filtered tree is that you change the model without notifying anybody about it. You change the tree's structure from a tree cell editor. I think that is a bad idea, maybe you should use SwingUtilities.InvokeLater. I'm just guessing, so I hope some JTree guru will give the correct answer to your question. Till then I suggest you to check these examples which shows how can you make a tree which allows hiding/showing nodes.
http://forums.sun.com/thread.jspa?threadID=563514&forumID=57
http://www.kidslovepc.com/javatable/java-jtree-show-hide.shtml

15 years ago
Hi Arthur,

There's no one correct way. For your own you should choose one of them, and use that in all your code. When you work for a company they usually have their coding standards so in that case use that of course. I personally prefer the second one.
15 years ago
Hi Edmund,

Please post an Short, Self Contained, Correct (Compilable), Example.
From this code I can't see anything. You create a new DefaultListModel and that's all. How do you change your list's model? The content of the listmodel shouldn't prevent you to select anything, so my guessing is that there's some problem in other part of your code.
15 years ago