The Profile View
Sending SOAP messages is a lot easier if you specify a profile when you
create the MessageFactory object that will spawn the message. The
profile tells the MessageFactory to generate SOAP messages that comply
with a specific message format standard, such as ebXML.
You can find out what profiles your messaging provider supports by
opening a connection to the messaging provider, like this...
ctx = newInitialContext();
ProviderConnectionFactory pcf =
(ProviderConnectionFactory)ctx.lookup("MessagingProviderName");
ProviderConnection pc = pcf.createConnection();
...and then extracting the ProviderMetaData object from that and taking
an array of profiles from the ProviderMetaData, like this...
ProviderMetaData pmd = pc.getMetaData();
String[] supportedProfiles = pmd.getSupportedProfiles();
String desiredProfile = null;
You can then examine the array elements one at a time until you find one
that matches the specification you want:
for (int i=0; i
desiredProfile = supportedProfiles[i];
break;
}
}
Once you've done that, you can proceed to create a SOAP message based on
the messaginf profile you got from your search. You'd do that like this:
MessageFactory mf = pc.createMessageFactory(desiredProfile);
EbXMLMessageImpl ebxmlMsg = (EbXMLMessageImpl)mf.createMessage();
» posted by ITworld staff
ITworld
Win an Amazon Kindle!
This month's giveaway gadget - Amazon's Kindle - will keep you entertained on the long trip home to visit family and friends over the holidays. Enter the drawing now!
Applied Security Visualization
By Raffael Marty
Published by Addison-Wesley Professional
Learn more!

IT Manager's Handbook
By Bill Holtsnider and Brian D. Jaffe
Published by Morgan Kaufmann
Learn more!

Windows Vista Resource Kit
By Mitch Tulloch, Tony Northrup, and Jerry Honeycutt
Published by Microsoft Press
Learn more!








