1.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/saaj/SAAJFactory.java Thu May 30 10:58:13 2013 -0700 1.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/api/message/saaj/SAAJFactory.java Wed Jun 12 14:47:09 2013 +0100 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -173,7 +173,13 @@ 1.11 * @throws SOAPException if SAAJ processing fails 1.12 */ 1.13 public static SAAJMessage read(Packet packet) throws SOAPException { 1.14 - for (SAAJFactory s : ServiceFinder.find(SAAJFactory.class)) { 1.15 + // Use the Component from the Packet if it exists. Note the logic 1.16 + // in the ServiceFinder is such that find(Class) is not equivalent 1.17 + // to find (Class, null), so the ternary operator is needed. 1.18 + ServiceFinder<SAAJFactory> factories = (packet.component != null ? 1.19 + ServiceFinder.find(SAAJFactory.class, packet.component) : 1.20 + ServiceFinder.find(SAAJFactory.class)); 1.21 + for (SAAJFactory s : factories) { 1.22 SAAJMessage msg = s.readAsSAAJ(packet); 1.23 if (msg != null) return msg; 1.24 }