Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

MessageFactory versions  RSS feed

 
chaitu sravs
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a bunch of raw SOAP request files that I am reading using MessageFactory of SAAJ API.

Some files are SOAP1.1 and others are SOAP1.2.

How do I know which version a given file is, so that I can create the appropriate factory? Or is there a way how MessageFactory can work for both the versions?
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
First, to determine whether a SOAP message is version 1.1 or 1.2, you can look at the namespace:
SOAP 1.1: http://schemas.xmlsoap.org/soap/envelope/
SOAP 1.2: http://www.w3.org/2003/05/soap-envelope

Second, in the interface javax.xml.soap.SOAPConstants there are some useful constants for creating different kinds of MessageFactor-ies; one for SOAP 1.1, one for SOAP 1.2 and another one that looks at the Content-Type MIME header to determine what kind of SOAP message to create.
Best wishes!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!