• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

MessageFactory versions

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
I can't take it! You are too smart for me! Here is the tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic