This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

MessageFactory versions  RSS feed

 
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?
 
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!
 
machines help you to do more, but experience less. Experience this tiny ad:
Enterprise Java integration with Delphi and Free Pascal applications - new release 2019.02
https://coderanch.com/t/705708/Enterprise-Java-integration-Delphi-Free
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!