• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Troubles with wss4j

 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Working through the turorials Axis Deployment Tutorial and Axis Deployment Examples has turned out to be desasterous for me. I had a really hard time understanding them. I have no idea what or why I am doing something. Then when the code did not work, I had no idea how to fix it.

I ran into all of the problems in this posting WSS4J problem in Axis

But I continue to get errors. Here is the xml I am sending:



When I redeploy the service without the security constraints I get this back:



When I redeploy it with security turned on I get this error:


Any ideas?
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is that the complete error message ? can you see any error description along with it ? like at what line/stage/java file etc.,
Thank you.
 
Rusty Enisin
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nope. That is all there was. I have been banging my head against the wall trying to figure this out. There was nothing in the logs either. In an effort to "gain more control" I have decided to try to extend WSDoAllReceiver. This appears to be working better. Then I can parse the Header myself. But I feel I am rewriting something that is already done. If I could just figure out how this framework works. Or rather, make it work without generating errors...
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have WSS4J running on the server? The error message seems to be coming from Axis, not WSS4J. Did you have nay problems running the examples?
 
Rusty Enisin
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Axis. Axis is happy and all Axis examples run without problems. I had a difficult time running the wss4j examples. I was getting this same error. So I decided to try and roll my own.

I have tried to track this down. I went to the top of the stack.

-> org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:473)

This was were a RuntimeException was caught. After some more investigating, it looked like this was failing on parsing the soap header. But the lack of logging and commenting makes it really difficult for me to read through it. And on top of that documentation ( examples, how to docs, tutorials, etc ) are very limited. The ones I do find don't help much.

I ended up writing my own subclass of WSDoAllReceiver. I learned a ton about the framework ( and WSDoAllReceiver ) in doing this. I have a class that works ( the beginnings of a prototype ). But it is limited in features. I hope to work my way back to WSDoAllReceiver so I can find out what I did wrong.
 
Rusty Enisin
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wrote my own WSDoAllReceiver. In the process I leaned a lot about the framework. But the examples still would not work. I tracked that down. I got a very generic error with no clue as to why it will not work. See the exception above.

The problem is in the tutorial you are told to use this in the first tag in the header:



That is incorrect. It should be this:



Arg! They had me using the wrong namespace! Appreciate this find. It tooks me hours and a lot of source code diving and trial-and-error coding to find this. Hopefully it will save you some.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm curious - why are you generating the tags yourself? I've always let WSS4J generate the actual SOAP elements; do you have a case where that doesn't work?
 
Rusty Enisin
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was following the tutorial. They said use those tags so I did.

Our clients are not always going to be able to use Axis. Our clients could be .Net, PHP, PERL, Java, or anything else you can think of. Hopefully they will use the WSDL to generate the tags. No guarantees though. The client I am using allows me to paste any xml into a field and then send it to a url. This works really well if you have to make small tweeks to the xml or you want to try different things.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
WSDL does not generate messages - it prescribes how messages should look like, but they are generated by some other means. If you have a WSDL description of your service, then you should not accept anything that does not conform to it.

WS-Security is a cross-platform standard, with WSS4J being the standard Java implementation. You should not have problems using other languages WS-Security facilities to connect to a WSS4J server, or vice-versa. Generating SOAP (and its more complicated variants like WS-Security) by hand seems a bad idea.
 
Rusty Enisin
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Never thought WSDL itself generated the tags. But something else will use the WSDL to generate code (WSDL2Java) that in turn knows how to generate the tags, no? Therefore I stick by my previous statement "Hopefully they will use the WSDL to generate the tags." Notice the "the" in "the WSDL". I did not write "they will use WSDL to generate the tags". WSDL is not a tool. I don't think I could have gotten this far if I did think it was a tool.

Now that we are officially way off topic. I understand you must find a lot of inquisative idiots in this forum. I must appear to you to be the same. Let's not treat each other that way. I appreciate your help. But doing this will lead us nowhere.

Now, as for "hand coding" the SOAP. I did that only for the tutorial. In no way will that make it to production. It was a convenient way to follow the tutorial. I am not quite to sure why I am being tested on this. Again, here we are way off topic.
 
reply
    Bookmark Topic Watch Topic
  • New Topic