• 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

Query regarding SAAJ API

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

As told by you i am able to invoke a web service through a SAAJ client without requiring any client artifacts

Now i have a query regarding a scenario which i am facing , I am making a SOAP message using an external file.
but it is showing strange behaviour.



The first msg.writeTo(System.out) is displaying the correct result

%%%%%%%%%%Creating a soap message from an external file%%%%%%%%
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body><ns:multiply xmlns:ns="http://saaj.com/"><arg0>80</arg0><arg1>10<
/arg1></ns:multiply></SOAP-ENV:Body></SOAP-ENV:Envelope>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



but the last two System.out.println() are displaying



can you please clarify?

Thanks in Advance

Regards

Jolly
 
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 again!
First of all, you should close the input stream from which you read the SOAP message, as I show in my study notes.
Second, if you read the code in my study notes carefully, you would have noticed that it says that if you read a SOAP message from a file and there is a problem with the SOAP message, no error will be given and you won't experience any problems until you, for instance, try to retrieve the body or header of the SOAP message.
To test if your SOAP message has problems, I recommend replacing the contents of your input file with the example on page 200 in my study notes, which I know is correct.
Best wishes!
 
Jolly Tiwari
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! Ivan,


I tried your soap_input.xml file also ,everything is running fine but this snippet from my last post

System.out.println(hdr);
System.out.println(bod);



gives

[SOAP-ENV:Header: null]
[SOAP-ENV:Body: null]




Unable to figure out why??

Regards

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