• 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

Problem calling Axis SWA web service

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

I have a simple web service that uses axis 1.4.1. This web service returns a SOAPMessage when invoqued by a little java client I developped. Everything works fine when the soapMessage returned by the webservice don't have any attachment.

When I add an attachment to the soapmessage returned by the webservice, the following error occurs:



Note that In my services.xml file I have the following line:
<parameter name="enableSwA" locked="false">true</parameter>

Here is the code I use to build the SOAPMessage that is returned by my webservice:


Resuming: If I have the 3 last lines of presented code, the error occurs. If not, everything works fine.

I am using java 1.6.

Thanks for your help!

 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
Try setting the content id of the attachment before you add it to the message.
Example:

Best wishes!
 
Paulo Carvalho
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

Thanks for your answer and help.

I tried your suggestion but the result (error) is the same.

Here goes my code. Any help?



Thanks

Ivan Krizsan wrote:Hi!
Try setting the content id of the attachment before you add it to the message.
Example:

Best wishes!

 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
Sorry, your code looks very much like code I have written myself. I did not use Axis, though.
Are you able to capture the packets going to and from your web service and examine the message that causes the error?
Best wishes!
 
Paulo Carvalho
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What did you use instead Axis (if you used something else) ?

thanks

best regards

Ivan Krizsan wrote:Hi!
Sorry, your code looks very much like code I have written myself. I did not use Axis, though.
Are you able to capture the packets going to and from your web service and examine the message that causes the error?
Best wishes!

 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

Paulo Carvalho wrote:What did you use instead Axis (if you used something else) ?


I used Metro in GlassFish.
My example program can be found in the document here: http://faq.javaranch.com/content/Exam-Objectives-5.pdf
Best wishes!
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paulo Carvalho wrote:Hello

I have a simple web service that uses axis 1.4.1. This web service returns a SOAPMessage when invoqued by a little java client I developped. Everything works fine when the soapMessage returned by the webservice don't have any attachment.

When I add an attachment to the soapmessage returned by the webservice, the following error occurs:



Note that In my services.xml file I have the following line:
<parameter name="enableSwA" locked="false">true</parameter>

Here is the code I use to build the SOAPMessage that is returned by my webservice:


Resuming: If I have the 3 last lines of presented code, the error occurs. If not, everything works fine.

I am using java 1.6.

Thanks for your help!




This is basically happening because of Axis2, you are using Axis1.4 and you have axis2-saaj-1.6.2.jar in your Class path.

Remove this jar and put jar XmlSchema-1.1.jar(or higher version). I think this should help.


 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic