diff -r 7386eca865e1 -r 8f2986ff0235 src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/saaj/SAAJFactory.java --- a/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/saaj/SAAJFactory.java Thu May 30 10:58:13 2013 -0700 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/saaj/SAAJFactory.java Wed Jun 12 14:47:09 2013 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -173,7 +173,13 @@ * @throws SOAPException if SAAJ processing fails */ public static SAAJMessage read(Packet packet) throws SOAPException { - for (SAAJFactory s : ServiceFinder.find(SAAJFactory.class)) { + // Use the Component from the Packet if it exists. Note the logic + // in the ServiceFinder is such that find(Class) is not equivalent + // to find (Class, null), so the ternary operator is needed. + ServiceFinder factories = (packet.component != null ? + ServiceFinder.find(SAAJFactory.class, packet.component) : + ServiceFinder.find(SAAJFactory.class)); + for (SAAJFactory s : factories) { SAAJMessage msg = s.readAsSAAJ(packet); if (msg != null) return msg; }