1 /* |
1 /* |
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
38 import org.w3c.dom.Node; |
38 import org.w3c.dom.Node; |
39 import org.w3c.dom.NodeList; |
39 import org.w3c.dom.NodeList; |
40 |
40 |
41 import javax.xml.namespace.NamespaceContext; |
41 import javax.xml.namespace.NamespaceContext; |
42 import javax.xml.namespace.QName; |
42 import javax.xml.namespace.QName; |
43 import javax.xml.xpath.XPath; |
43 import javax.xml.xpath.*; |
44 import javax.xml.xpath.XPathConstants; |
|
45 import javax.xml.xpath.XPathExpressionException; |
|
46 import javax.xml.xpath.XPathFactory; |
|
47 import java.util.Iterator; |
44 import java.util.Iterator; |
48 import java.util.Map; |
45 import java.util.Map; |
49 |
46 |
50 |
47 |
51 /** |
48 /** |
54 * jaxws:bindings exension handler. |
51 * jaxws:bindings exension handler. |
55 * |
52 * |
56 */ |
53 */ |
57 public class JAXWSBindingExtensionHandler extends AbstractExtensionHandler { |
54 public class JAXWSBindingExtensionHandler extends AbstractExtensionHandler { |
58 |
55 |
59 private static final XPathFactory xpf = XPathFactory.newInstance(); |
56 // xml security enabled always, xpath used for parsing "part" attribute |
|
57 private static final XPathFactory xpf = XmlUtil.newXPathFactory(true); |
60 private final XPath xpath = xpf.newXPath(); |
58 private final XPath xpath = xpf.newXPath(); |
61 |
59 |
62 public JAXWSBindingExtensionHandler(Map<String, AbstractExtensionHandler> extensionHandlerMap) { |
60 public JAXWSBindingExtensionHandler(Map<String, AbstractExtensionHandler> extensionHandlerMap) { |
63 super(extensionHandlerMap); |
61 super(extensionHandlerMap); |
64 } |
62 } |
65 |
63 |
66 /* (non-Javadoc) |
64 /* (non-Javadoc) |
67 * @see AbstractExtensionHandler#getNamespaceURI() |
65 * @see AbstractExtensionHandler#getNamespaceURI() |
68 */ |
66 */ |
|
67 @Override |
69 public String getNamespaceURI() { |
68 public String getNamespaceURI() { |
70 return JAXWSBindingsConstants.NS_JAXWS_BINDINGS; |
69 return JAXWSBindingsConstants.NS_JAXWS_BINDINGS; |
71 } |
70 } |
72 |
71 |
73 /** |
72 /** |
78 private boolean parseGlobalJAXWSBindings(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
77 private boolean parseGlobalJAXWSBindings(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
79 context.push(); |
78 context.push(); |
80 context.registerNamespaces(e); |
79 context.registerNamespaces(e); |
81 |
80 |
82 JAXWSBinding jaxwsBinding = getJAXWSExtension(parent); |
81 JAXWSBinding jaxwsBinding = getJAXWSExtension(parent); |
83 if(jaxwsBinding == null) |
82 if(jaxwsBinding == null) { |
84 jaxwsBinding = new JAXWSBinding(context.getLocation(e)); |
83 jaxwsBinding = new JAXWSBinding(context.getLocation(e)); |
|
84 } |
85 String attr = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.WSDL_LOCATION_ATTR); |
85 String attr = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.WSDL_LOCATION_ATTR); |
86 if (attr != null) { |
86 if (attr != null) { |
87 jaxwsBinding.setWsdlLocation(attr); |
87 jaxwsBinding.setWsdlLocation(attr); |
88 } |
88 } |
89 |
89 |
97 jaxwsBinding.setVersion(attr); |
97 jaxwsBinding.setVersion(attr); |
98 } |
98 } |
99 |
99 |
100 for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ |
100 for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ |
101 Element e2 = Util.nextElement(iter); |
101 Element e2 = Util.nextElement(iter); |
102 if (e2 == null) |
102 if (e2 == null) { |
103 break; |
103 break; |
104 |
104 } |
105 if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PACKAGE)){ |
105 |
|
106 if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PACKAGE)) { |
106 parsePackage(context, jaxwsBinding, e2); |
107 parsePackage(context, jaxwsBinding, e2); |
107 if((jaxwsBinding.getJaxwsPackage() != null) && (jaxwsBinding.getJaxwsPackage().getJavaDoc() != null)){ |
108 if ((jaxwsBinding.getJaxwsPackage() != null) && (jaxwsBinding.getJaxwsPackage().getJavaDoc() != null)) { |
108 ((Definitions)parent).setDocumentation(new Documentation(jaxwsBinding.getJaxwsPackage().getJavaDoc())); |
109 ((Definitions) parent).setDocumentation(new Documentation(jaxwsBinding.getJaxwsPackage().getJavaDoc())); |
109 } |
110 } |
110 }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)){ |
111 } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)) { |
111 parseWrapperStyle(context, jaxwsBinding, e2); |
112 parseWrapperStyle(context, jaxwsBinding, e2); |
112 }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)){ |
113 } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)) { |
113 parseAsynMapping(context, jaxwsBinding, e2); |
114 parseAsynMapping(context, jaxwsBinding, e2); |
114 } |
115 } // else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){ |
115 // else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){ |
116 // parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2); |
116 // parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2); |
117 // } |
117 // } |
118 else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_MIME_CONTENT)) { |
118 else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_MIME_CONTENT)){ |
|
119 parseMimeContent(context, jaxwsBinding, e2); |
119 parseMimeContent(context, jaxwsBinding, e2); |
120 }else{ |
120 } else { |
121 Util.fail( |
121 Util.fail( |
122 "parsing.invalidExtensionElement", |
122 "parsing.invalidExtensionElement", |
123 e2.getTagName(), |
123 e2.getTagName(), |
124 e2.getNamespaceURI()); |
124 e2.getNamespaceURI()); |
125 return false; |
125 return false; |
126 } |
126 } |
127 } |
127 } |
128 parent.addExtension(jaxwsBinding); |
128 parent.addExtension(jaxwsBinding); |
129 context.pop(); |
129 context.pop(); |
148 * @param parent |
148 * @param parent |
149 * @param e |
149 * @param e |
150 */ |
150 */ |
151 private void parseProvider(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) { |
151 private void parseProvider(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) { |
152 String val = e.getTextContent(); |
152 String val = e.getTextContent(); |
153 if(val == null) |
153 if (val == null) { |
154 return; |
154 return; |
155 if(val.equals("false") || val.equals("0")){ |
155 } |
|
156 if (val.equals("false") || val.equals("0")) { |
156 ((JAXWSBinding)parent).setProvider(Boolean.FALSE); |
157 ((JAXWSBinding)parent).setProvider(Boolean.FALSE); |
157 }else if(val.equals("true") || val.equals("1")){ |
158 } else if(val.equals("true") || val.equals("1")) { |
158 ((JAXWSBinding)parent).setProvider(Boolean.TRUE); |
159 ((JAXWSBinding)parent).setProvider(Boolean.TRUE); |
159 } |
160 } |
160 |
161 |
161 } |
|
162 |
|
163 /** |
|
164 * |
|
165 * @param context |
|
166 * @param parent |
|
167 * @param e |
|
168 */ |
|
169 private void parseJAXBBindings(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
|
170 JAXWSBinding binding = (JAXWSBinding)parent; |
|
171 binding.addJaxbBindings(e); |
|
172 } |
162 } |
173 |
163 |
174 /** |
164 /** |
175 * @param context |
165 * @param context |
176 * @param parent |
166 * @param parent |
189 * @param e |
179 * @param e |
190 */ |
180 */ |
191 private void parseWrapperStyle(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) { |
181 private void parseWrapperStyle(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) { |
192 //System.out.println("In handleWrapperStyleExtension: " + e.getNodeName()); |
182 //System.out.println("In handleWrapperStyleExtension: " + e.getNodeName()); |
193 String val = e.getTextContent(); |
183 String val = e.getTextContent(); |
194 if(val == null) |
184 if (val == null) { |
195 return; |
185 return; |
196 if(val.equals("false") || val.equals("0")){ |
186 } |
197 ((JAXWSBinding)parent).setEnableWrapperStyle(Boolean.FALSE); |
187 if (val.equals("false") || val.equals("0")) { |
198 }else if(val.equals("true") || val.equals("1")){ |
188 ((JAXWSBinding) parent).setEnableWrapperStyle(Boolean.FALSE); |
199 ((JAXWSBinding)parent).setEnableWrapperStyle(Boolean.TRUE); |
189 } else if (val.equals("true") || val.equals("1")) { |
|
190 ((JAXWSBinding) parent).setEnableWrapperStyle(Boolean.TRUE); |
200 } |
191 } |
201 } |
192 } |
202 |
193 |
203 /** |
194 /** |
204 * @param context |
195 * @param context |
223 * @param e |
214 * @param e |
224 */ |
215 */ |
225 private void parseAsynMapping(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) { |
216 private void parseAsynMapping(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) { |
226 //System.out.println("In handleAsynMappingExtension: " + e.getNodeName()); |
217 //System.out.println("In handleAsynMappingExtension: " + e.getNodeName()); |
227 String val = e.getTextContent(); |
218 String val = e.getTextContent(); |
228 if(val == null) |
219 if (val == null) { |
229 return; |
220 return; |
230 if(val.equals("false") || val.equals("0")){ |
221 } |
231 ((JAXWSBinding)parent).setEnableAsyncMapping(Boolean.FALSE); |
222 if (val.equals("false") || val.equals("0")) { |
232 }else if(val.equals("true") || val.equals("1")){ |
223 ((JAXWSBinding) parent).setEnableAsyncMapping(Boolean.FALSE); |
233 ((JAXWSBinding)parent).setEnableAsyncMapping(Boolean.TRUE); |
224 } else if (val.equals("true") || val.equals("1")) { |
|
225 ((JAXWSBinding) parent).setEnableAsyncMapping(Boolean.TRUE); |
234 } |
226 } |
235 } |
227 } |
236 |
228 |
237 /** |
229 /** |
238 * @param context |
230 * @param context |
240 * @param e |
232 * @param e |
241 */ |
233 */ |
242 private void parseMimeContent(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) { |
234 private void parseMimeContent(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding parent, Element e) { |
243 //System.out.println("In handleMimeContentExtension: " + e.getNodeName()); |
235 //System.out.println("In handleMimeContentExtension: " + e.getNodeName()); |
244 String val = e.getTextContent(); |
236 String val = e.getTextContent(); |
245 if(val == null) |
237 if (val == null) { |
246 return; |
238 return; |
247 if(val.equals("false") || val.equals("0")){ |
239 } |
248 ((JAXWSBinding)parent).setEnableMimeContentMapping(Boolean.FALSE); |
240 if (val.equals("false") || val.equals("0")) { |
249 }else if(val.equals("true") || val.equals("1")){ |
241 ((JAXWSBinding) parent).setEnableMimeContentMapping(Boolean.FALSE); |
250 ((JAXWSBinding)parent).setEnableMimeContentMapping(Boolean.TRUE); |
242 } else if (val.equals("true") || val.equals("1")) { |
|
243 ((JAXWSBinding) parent).setEnableMimeContentMapping(Boolean.TRUE); |
251 } |
244 } |
252 } |
245 } |
253 |
246 |
254 /** |
247 /** |
255 * @param context |
248 * @param context |
274 Node msgElm = msgPartElm.getParentNode(); |
267 Node msgElm = msgPartElm.getParentNode(); |
275 //MessagePart msgPart = new MessagePart(); |
268 //MessagePart msgPart = new MessagePart(); |
276 |
269 |
277 String partName = XmlUtil.getAttributeOrNull(msgPartElm, "name"); |
270 String partName = XmlUtil.getAttributeOrNull(msgPartElm, "name"); |
278 String msgName = XmlUtil.getAttributeOrNull((Element)msgElm, "name"); |
271 String msgName = XmlUtil.getAttributeOrNull((Element)msgElm, "name"); |
279 if((partName == null) || (msgName == null)) |
272 if ((partName == null) || (msgName == null)) { |
280 return; |
273 return; |
281 |
274 } |
282 String val = XmlUtil.getAttributeOrNull(msgPartElm, "element"); |
|
283 |
275 |
284 String element = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.ELEMENT_ATTR); |
276 String element = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.ELEMENT_ATTR); |
285 String name = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.NAME_ATTR); |
277 String name = XmlUtil.getAttributeOrNull(e, JAXWSBindingsConstants.NAME_ATTR); |
286 |
278 |
287 QName elementName = null; |
279 QName elementName = null; |
331 String javaDoc = getJavaDoc(e); |
323 String javaDoc = getJavaDoc(e); |
332 jaxwsBinding.setClassName(new CustomName(className, javaDoc)); |
324 jaxwsBinding.setClassName(new CustomName(className, javaDoc)); |
333 } |
325 } |
334 |
326 |
335 |
327 |
336 /** |
328 @Override |
337 * @param context |
|
338 * @param jaxwsBinding |
|
339 * @param e |
|
340 */ |
|
341 private void parseException(com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext context, JAXWSBinding jaxwsBinding, Element e) { |
|
342 for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ |
|
343 Element e2 = Util.nextElement(iter); |
|
344 if (e2 == null) |
|
345 break; |
|
346 if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)){ |
|
347 String className = XmlUtil.getAttributeOrNull(e2, JAXWSBindingsConstants.NAME_ATTR); |
|
348 String javaDoc = getJavaDoc(e2); |
|
349 jaxwsBinding.setException(new com.sun.tools.internal.ws.wsdl.document.jaxws.Exception(new CustomName(className, javaDoc))); |
|
350 } |
|
351 } |
|
352 } |
|
353 |
|
354 public boolean handleDefinitionsExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
329 public boolean handleDefinitionsExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
355 return parseGlobalJAXWSBindings(context, parent, e); |
330 return parseGlobalJAXWSBindings(context, parent, e); |
356 } |
331 } |
357 |
332 |
|
333 @Override |
358 public boolean handlePortTypeExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
334 public boolean handlePortTypeExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
359 if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ |
335 if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ |
360 context.push(); |
336 context.push(); |
361 context.registerNamespaces(e); |
337 context.registerNamespaces(e); |
362 JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); |
338 JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); |
363 |
339 |
364 for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ |
340 for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ |
365 Element e2 = Util.nextElement(iter); |
341 Element e2 = Util.nextElement(iter); |
366 if (e2 == null) |
342 if (e2 == null) { |
367 break; |
343 break; |
368 |
344 } |
369 if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)){ |
345 |
|
346 if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)) { |
370 parseWrapperStyle(context, jaxwsBinding, e2); |
347 parseWrapperStyle(context, jaxwsBinding, e2); |
371 }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)){ |
348 } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)) { |
372 parseAsynMapping(context, jaxwsBinding, e2); |
349 parseAsynMapping(context, jaxwsBinding, e2); |
373 }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)){ |
350 } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)) { |
374 parseClass(context, jaxwsBinding, e2); |
351 parseClass(context, jaxwsBinding, e2); |
375 if((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null)){ |
352 if ((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null) && (parent instanceof PortType)) { |
376 ((PortType)parent).setDocumentation(new Documentation(jaxwsBinding.getClassName().getJavaDoc())); |
353 ((PortType) parent).setDocumentation(new Documentation(jaxwsBinding.getClassName().getJavaDoc())); |
377 } |
354 } |
378 }else{ |
355 } else { |
379 Util.fail( |
356 Util.fail( |
380 "parsing.invalidExtensionElement", |
357 "parsing.invalidExtensionElement", |
381 e2.getTagName(), |
358 e2.getTagName(), |
382 e2.getNamespaceURI()); |
359 e2.getNamespaceURI()); |
383 return false; |
360 return false; |
384 } |
361 } |
385 } |
362 } |
386 parent.addExtension(jaxwsBinding); |
363 parent.addExtension(jaxwsBinding); |
387 context.pop(); |
364 context.pop(); |
396 e.getNamespaceURI()); |
373 e.getNamespaceURI()); |
397 return false; |
374 return false; |
398 } |
375 } |
399 } |
376 } |
400 |
377 |
|
378 @Override |
401 public boolean handleOperationExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
379 public boolean handleOperationExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
402 if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ |
380 if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ |
403 if(parent instanceof Operation){ |
381 if(parent instanceof Operation){ |
404 return handlePortTypeOperation(context, (Operation)parent, e); |
382 return handlePortTypeOperation(context, (Operation)parent, e); |
405 }else if(parent instanceof BindingOperation){ |
383 }else if(parent instanceof BindingOperation){ |
421 context.registerNamespaces(e); |
399 context.registerNamespaces(e); |
422 JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); |
400 JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); |
423 |
401 |
424 for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ |
402 for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ |
425 Element e2 = Util.nextElement(iter); |
403 Element e2 = Util.nextElement(iter); |
426 if (e2 == null) |
404 if (e2 == null) { |
427 break; |
405 break; |
|
406 } |
428 |
407 |
429 // if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){ |
408 // if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){ |
430 // parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2); |
409 // parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2); |
431 // }else |
410 // }else |
432 if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_MIME_CONTENT)){ |
411 if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_MIME_CONTENT)){ |
461 context.registerNamespaces(e); |
440 context.registerNamespaces(e); |
462 JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); |
441 JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); |
463 |
442 |
464 for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ |
443 for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ |
465 Element e2 = Util.nextElement(iter); |
444 Element e2 = Util.nextElement(iter); |
466 if (e2 == null) |
445 if (e2 == null) { |
467 break; |
446 break; |
|
447 } |
468 |
448 |
469 if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)){ |
449 if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)){ |
470 parseWrapperStyle(context, jaxwsBinding, e2); |
450 parseWrapperStyle(context, jaxwsBinding, e2); |
471 }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)){ |
451 }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)){ |
472 parseAsynMapping(context, jaxwsBinding, e2); |
452 parseAsynMapping(context, jaxwsBinding, e2); |
491 // JAXWSBindingsConstants.JAXWS_BINDINGS, |
471 // JAXWSBindingsConstants.JAXWS_BINDINGS, |
492 // jaxwsBinding); |
472 // jaxwsBinding); |
493 return true; |
473 return true; |
494 } |
474 } |
495 |
475 |
|
476 @Override |
496 public boolean handleBindingExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
477 public boolean handleBindingExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
497 if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ |
478 if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ |
498 context.push(); |
479 context.push(); |
499 context.registerNamespaces(e); |
480 context.registerNamespaces(e); |
500 JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); |
481 JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); |
501 |
482 |
502 for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ |
483 for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ |
503 Element e2 = Util.nextElement(iter); |
484 Element e2 = Util.nextElement(iter); |
504 if (e2 == null) |
485 if (e2 == null) { |
505 break; |
486 break; |
|
487 } |
506 |
488 |
507 // if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){ |
489 // if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){ |
508 // parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2); |
490 // parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2); |
509 // }else |
491 // }else |
510 if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_MIME_CONTENT)){ |
492 if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_MIME_CONTENT)){ |
533 } |
515 } |
534 |
516 |
535 /* (non-Javadoc) |
517 /* (non-Javadoc) |
536 * @see ExtensionHandlerBase#handleFaultExtension(TWSDLParserContextImpl, TWSDLExtensible, org.w3c.dom.Element) |
518 * @see ExtensionHandlerBase#handleFaultExtension(TWSDLParserContextImpl, TWSDLExtensible, org.w3c.dom.Element) |
537 */ |
519 */ |
|
520 @Override |
538 public boolean handleFaultExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
521 public boolean handleFaultExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
539 if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ |
522 if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ |
540 context.push(); |
523 context.push(); |
541 context.registerNamespaces(e); |
524 context.registerNamespaces(e); |
542 JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); |
525 JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); |
543 |
526 |
544 for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ |
527 for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ |
545 Element e2 = Util.nextElement(iter); |
528 Element e2 = Util.nextElement(iter); |
546 if (e2 == null) |
529 if (e2 == null) { |
547 break; |
530 break; |
|
531 } |
548 if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)){ |
532 if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)){ |
549 parseClass(context, jaxwsBinding, e2); |
533 parseClass(context, jaxwsBinding, e2); |
550 if((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null)){ |
534 if((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null)){ |
551 ((Fault)parent).setDocumentation(new Documentation(jaxwsBinding.getClassName().getJavaDoc())); |
535 ((Fault)parent).setDocumentation(new Documentation(jaxwsBinding.getClassName().getJavaDoc())); |
552 } |
536 } |
571 e.getNamespaceURI()); |
555 e.getNamespaceURI()); |
572 return false; |
556 return false; |
573 } |
557 } |
574 } |
558 } |
575 |
559 |
|
560 @Override |
576 public boolean handleServiceExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
561 public boolean handleServiceExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
577 if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ |
562 if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ |
578 context.push(); |
563 context.push(); |
579 context.registerNamespaces(e); |
564 context.registerNamespaces(e); |
580 JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); |
565 JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); |
581 |
566 |
582 for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ |
567 for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ |
583 Element e2 = Util.nextElement(iter); |
568 Element e2 = Util.nextElement(iter); |
584 if (e2 == null) |
569 if (e2 == null) { |
585 break; |
570 break; |
|
571 } |
586 if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)){ |
572 if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)){ |
587 parseClass(context, jaxwsBinding, e2); |
573 parseClass(context, jaxwsBinding, e2); |
588 if((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null)){ |
574 if((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null)){ |
589 ((Service)parent).setDocumentation(new Documentation(jaxwsBinding.getClassName().getJavaDoc())); |
575 ((Service)parent).setDocumentation(new Documentation(jaxwsBinding.getClassName().getJavaDoc())); |
590 } |
576 } |
609 e.getNamespaceURI()); |
595 e.getNamespaceURI()); |
610 return false; |
596 return false; |
611 } |
597 } |
612 } |
598 } |
613 |
599 |
|
600 @Override |
614 public boolean handlePortExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
601 public boolean handlePortExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { |
615 if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ |
602 if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ |
616 context.push(); |
603 context.push(); |
617 context.registerNamespaces(e); |
604 context.registerNamespaces(e); |
618 JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); |
605 JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); |
619 |
606 |
620 for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ |
607 for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ |
621 Element e2 = Util.nextElement(iter); |
608 Element e2 = Util.nextElement(iter); |
622 if (e2 == null) |
609 if (e2 == null) { |
623 break; |
610 break; |
|
611 } |
624 |
612 |
625 if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PROVIDER)){ |
613 if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PROVIDER)){ |
626 parseProvider(context, jaxwsBinding, e2); |
614 parseProvider(context, jaxwsBinding, e2); |
627 }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.METHOD)){ |
615 }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.METHOD)){ |
628 parseMethod(context, jaxwsBinding, e2); |
616 parseMethod(context, jaxwsBinding, e2); |