KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > wsdl > model > extensions > soap > validation > SOAPComponentValidator


1 package org.netbeans.modules.xml.wsdl.model.extensions.soap.validation;
2
3 import java.net.URI JavaDoc;
4 import java.net.URL JavaDoc;
5 import java.util.Collection JavaDoc;
6 import java.util.Collections JavaDoc;
7 import java.util.HashSet JavaDoc;
8 import java.util.Iterator JavaDoc;
9 import java.util.List JavaDoc;
10 import org.netbeans.modules.xml.wsdl.model.Binding;
11 import org.netbeans.modules.xml.wsdl.model.BindingInput;
12 import org.netbeans.modules.xml.wsdl.model.BindingFault;
13 import org.netbeans.modules.xml.wsdl.model.BindingOperation;
14 import org.netbeans.modules.xml.wsdl.model.BindingOutput;
15 import org.netbeans.modules.xml.wsdl.model.Definitions;
16 import org.netbeans.modules.xml.wsdl.model.Input;
17 import org.netbeans.modules.xml.wsdl.model.Output;
18 import org.netbeans.modules.xml.wsdl.model.Port;
19 import org.netbeans.modules.xml.wsdl.model.Service;
20 import org.netbeans.modules.xml.wsdl.model.WSDLComponent;
21 import org.netbeans.modules.xml.wsdl.model.WSDLModel;
22 import org.netbeans.modules.xml.wsdl.model.extensions.soap.SOAPAddress;
23 import org.netbeans.modules.xml.wsdl.model.extensions.soap.SOAPBinding;
24 import org.netbeans.modules.xml.wsdl.model.extensions.soap.SOAPBody;
25 import org.netbeans.modules.xml.wsdl.model.extensions.soap.SOAPComponent;
26 import org.netbeans.modules.xml.wsdl.model.extensions.soap.SOAPFault;
27 import org.netbeans.modules.xml.wsdl.model.extensions.soap.SOAPHeader;
28 import org.netbeans.modules.xml.wsdl.model.extensions.soap.SOAPHeaderFault;
29 import org.netbeans.modules.xml.wsdl.model.extensions.soap.SOAPMessageBase;
30 import org.netbeans.modules.xml.wsdl.model.extensions.soap.SOAPOperation;
31 import org.netbeans.modules.xml.xam.Component;
32 import org.netbeans.modules.xml.xam.Model;
33 import org.netbeans.modules.xml.xam.Model.State;
34 import org.netbeans.modules.xml.xam.dom.NamedComponentReference;
35 import org.netbeans.modules.xml.wsdl.model.Message;
36 import org.netbeans.modules.xml.xam.spi.Validation;
37 import org.netbeans.modules.xml.xam.spi.Validation.ValidationType;
38 import org.netbeans.modules.xml.xam.spi.ValidationResult;
39 import org.netbeans.modules.xml.xam.spi.Validator;
40 import org.netbeans.modules.xml.xam.spi.Validator.ResultItem;
41 import org.openide.util.NbBundle;
42
43
44 /**
45  *
46  * @author afung
47  */

48 public class SOAPComponentValidator
49         implements Validator, SOAPComponent.Visitor {
50     
51     private static final String JavaDoc HTTP_DEFAULT_PORT_TOKEN = "${HttpDefaultPort}";
52     private static final String JavaDoc HTTPS_DEFAULT_PORT_TOKEN = "${HttpsDefaultPort}";
53     
54     private Validation mValidation;
55     private ValidationType mValidationType;
56     private ValidationResult mValidationResult;
57     
58     @SuppressWarnings JavaDoc("unchecked")
59     public static final ValidationResult EMPTY_RESULT =
60         new ValidationResult( Collections.EMPTY_SET,
61                 Collections.EMPTY_SET);
62     
63     /** Creates a new instance of SOAPComponentValidator */
64     public SOAPComponentValidator() {}
65     
66     /////////////////////////////////////////////
67
////
68
//// Validator interface
69
////
70
/////////////////////////////////////////////
71

72     /**
73      * Returns name of this validation service.
74      */

75     public String JavaDoc getName() {
76         return getClass().getName();
77     }
78     
79     /**
80      * Validates given model.
81      *
82      * @param model model to validate.
83      * @param validation reference to the validation context.
84      * @param validationType the type of validation to perform
85      * @return ValidationResult.
86      */

87     public ValidationResult validate(Model model, Validation validation,
88             ValidationType validationType) {
89         // Initialize the mValidation object
90
mValidation = validation;
91         
92         // Initialize the mValidationType object
93
mValidationType = validationType;
94         
95         // Initialize our result object
96
HashSet JavaDoc<ResultItem> results = new HashSet JavaDoc<ResultItem>();
97         HashSet JavaDoc<Model> models = new HashSet JavaDoc<Model>();
98         models.add(model);
99         mValidationResult = new ValidationResult(results, models);
100         
101         // Traverse the model
102
if (model instanceof WSDLModel) {
103             WSDLModel wsdlModel = (WSDLModel)model;
104             
105             if (model.getState() == State.NOT_WELL_FORMED) {
106                 return EMPTY_RESULT;
107             }
108             Definitions defs = wsdlModel.getDefinitions();
109             Iterator JavaDoc<Binding> bindings = defs.getBindings().iterator();
110             while (bindings.hasNext()) {
111                 Binding binding = bindings.next();
112                 int numSoapBindings = binding.getExtensibilityElements(SOAPBinding.class).size();
113                 if (numSoapBindings > 0 && numSoapBindings != 1) {
114                     results.add(
115                             new Validator.ResultItem(this,
116                             Validator.ResultType.ERROR,
117                             binding,
118                             NbBundle.getMessage(SOAPComponentValidator.class, "SOAPBindingValidator.Only_one_binding_allowed")));
119                 }
120                 Iterator JavaDoc<SOAPBinding> soapBindings =
121                         binding.getExtensibilityElements(SOAPBinding.class).iterator();
122                 while (soapBindings.hasNext()) {
123                     soapBindings.next().accept(this);
124                 }
125                 Iterator JavaDoc<BindingOperation> bindingOps =
126                         binding.getBindingOperations().iterator();
127                 while (bindingOps.hasNext()) {
128                     BindingOperation bindingOp = bindingOps.next();
129                     List JavaDoc soapOpsList = bindingOp.getExtensibilityElements(SOAPOperation.class);
130                     Iterator JavaDoc<SOAPOperation> soapOps =
131                             soapOpsList.iterator();
132                     while (soapOps.hasNext()) {
133                         soapOps.next().accept(this);
134                     }
135                     
136                     if(soapOpsList.size() > 0) {
137                         BindingInput bindingInput = bindingOp.getBindingInput();
138                         if (bindingInput != null) {
139                             Iterator JavaDoc<SOAPHeader> soapHeaders=
140                                     bindingInput.getExtensibilityElements(SOAPHeader.class).iterator();
141                             while (soapHeaders.hasNext()) {
142                                 SOAPHeader soapHeader = soapHeaders.next();
143                                 soapHeader.accept(this);
144                                 Iterator JavaDoc<SOAPHeaderFault> soapHeaderFaults =
145                                         soapHeader.getSOAPHeaderFaults().iterator();
146                                 while(soapHeaderFaults.hasNext()) {
147                                     soapHeaderFaults.next().accept(this);
148                                 }
149                             }
150                             
151                             int numSoapBodies = bindingInput.getExtensibilityElements(SOAPBody.class).size();
152                             if(numSoapBodies == 0) {
153                                 results.add(
154                                         new Validator.ResultItem(this,
155                                         Validator.ResultType.ERROR,
156                                         bindingInput,
157                                         NbBundle.getMessage(SOAPComponentValidator.class, "SOAPBodyValidator.Atleast_one_body_Required")));
158                                 
159                             } else if (numSoapBodies > 0 && numSoapBodies != 1) {
160                                 results.add(
161                                         new Validator.ResultItem(this,
162                                         Validator.ResultType.ERROR,
163                                         bindingInput,
164                                         NbBundle.getMessage(SOAPComponentValidator.class, "SOAPBodyValidator.Only_one_body_allowed")));
165                             }
166                             Iterator JavaDoc<SOAPBody> soapBodies =
167                                     bindingInput.getExtensibilityElements(SOAPBody.class).iterator();
168                             while(soapBodies.hasNext()) {
169                                 soapBodies.next().accept(this);
170                             }
171                         }
172                         
173                         BindingOutput bindingOutput = bindingOp.getBindingOutput();
174                         if (bindingOutput != null) {
175                             Iterator JavaDoc<SOAPHeader> soapHeaders=
176                                     bindingOutput.getExtensibilityElements(SOAPHeader.class).iterator();
177                             while (soapHeaders.hasNext()) {
178                                 SOAPHeader soapHeader = soapHeaders.next();
179                                 soapHeader.accept(this);
180                                 Iterator JavaDoc<SOAPHeaderFault> soapHeaderFaults =
181                                         soapHeader.getSOAPHeaderFaults().iterator();
182                                 while(soapHeaderFaults.hasNext()) {
183                                     soapHeaderFaults.next().accept(this);
184                                 }
185                             }
186                             
187                             int numSoapBodies = bindingOutput.getExtensibilityElements(SOAPBody.class).size();
188                             if(numSoapBodies == 0) {
189                                 results.add(
190                                         new Validator.ResultItem(this,
191                                         Validator.ResultType.ERROR,
192                                         bindingOutput,
193                                         NbBundle.getMessage(SOAPComponentValidator.class, "SOAPBodyValidator.Atleast_one_body_Required")));
194                                 
195                             } else if (numSoapBodies > 0 && numSoapBodies != 1) {
196                                 
197                                 results.add(
198                                         new Validator.ResultItem(this,
199                                         Validator.ResultType.ERROR,
200                                         bindingOutput,
201                                         NbBundle.getMessage(SOAPComponentValidator.class, "SOAPBodyValidator.Only_one_body_allowed")));
202                             }
203                             Iterator JavaDoc<SOAPBody> soapBodies =
204                                     bindingOutput.getExtensibilityElements(SOAPBody.class).iterator();
205                             while(soapBodies.hasNext()) {
206                                 soapBodies.next().accept(this);
207                             }
208                         }
209                         
210                         Iterator JavaDoc<BindingFault> bindingFaults =
211                                 bindingOp.getBindingFaults().iterator();
212                         while (bindingFaults.hasNext()) {
213                             BindingFault bindingFault = bindingFaults.next();
214                             int numSoapFaults = bindingFault.getExtensibilityElements(SOAPFault.class).size();
215                             if (numSoapFaults > 0 && numSoapFaults != 1) {
216                                 
217                                 results.add(
218                                         new Validator.ResultItem(this,
219                                         Validator.ResultType.ERROR,
220                                         bindingFault,
221                                         NbBundle.getMessage(SOAPComponentValidator.class, "SOAPFaultValidator.Only_one_fault_allowed")));
222                             }
223                             Iterator JavaDoc<SOAPFault> soapFaults =
224                                     bindingFault.getExtensibilityElements(SOAPFault.class).iterator();
225                             while(soapFaults.hasNext()) {
226                                 soapFaults.next().accept(this);
227                             }
228                         }
229                     }
230                 }
231             }
232             Iterator JavaDoc<Service> services = defs.getServices().iterator();
233             while (services.hasNext()) {
234                 Iterator JavaDoc<Port> ports = services.next().getPorts().iterator();
235                 while (ports.hasNext()) {
236                     Port port = ports.next();
237                     if(port.getBinding() != null) {
238                         Binding binding = port.getBinding().get();
239                         if(binding != null) {
240                             int numRelatedSoapBindings = binding.getExtensibilityElements(SOAPBinding.class).size();
241                             Iterator JavaDoc<SOAPAddress> soapAddresses = port.getExtensibilityElements(SOAPAddress.class).iterator();
242                             if((numRelatedSoapBindings > 0) && (!soapAddresses.hasNext())){
243                                 results.add(
244                                         new Validator.ResultItem(this,
245                                         Validator.ResultType.ERROR,
246                                         port,
247                                         NbBundle.getMessage(SOAPComponentValidator.class, "SOAPAddressValidator.Missing_SoapAddress")));
248                             }
249                             
250                             if(port.getExtensibilityElements(SOAPAddress.class).size() > 1){
251                                 results.add(
252                                         new Validator.ResultItem(this,
253                                         Validator.ResultType.ERROR,
254                                         port,
255                                         NbBundle.getMessage(SOAPComponentValidator.class, "SOAPAddressValidator.Only_one_SoapAddress_allowed")));
256                             }
257                             while (soapAddresses.hasNext()) {
258                                 soapAddresses.next().accept(this);
259                             }
260                         }
261                     }
262                 }
263             }
264         }
265         
266         // Clear out our state
267
mValidation = null;
268         mValidationType = null;
269     ValidationResult rv = mValidationResult;
270     mValidationResult = null;
271         
272         return rv;
273     }
274     
275     /////////////////////////////////////////////
276
////
277
//// SOAPComponent.Visitor interface
278
////
279
/////////////////////////////////////////////
280

281     public void visit(SOAPHeader header) {
282         Collection JavaDoc<ResultItem> results =
283                 mValidationResult.getValidationResult();
284         
285         
286         NamedComponentReference<Message> message = header.getMessage();
287         if (message == null) {
288             results.add(
289                     new Validator.ResultItem(this,
290                     Validator.ResultType.ERROR,
291                     header,
292                     NbBundle.getMessage(SOAPComponentValidator.class, "SOAPHeaderValidator.Missing_message")));
293         }
294         
295         String JavaDoc part = header.getPart();
296         if (part == null) {
297             results.add(
298                     new Validator.ResultItem(this,
299                     Validator.ResultType.ERROR,
300                     header,
301                     NbBundle.getMessage(SOAPComponentValidator.class, "SOAPHeaderValidator.Missing_part")));
302         }
303         
304         try {
305             SOAPMessageBase.Use use = header.getUse();
306             if (use == null) {
307                 results.add(
308                         new Validator.ResultItem(this,
309                         Validator.ResultType.ERROR,
310                         header,
311                         NbBundle.getMessage(SOAPComponentValidator.class, "SOAPHeaderValidator.Missing_use")));
312             }
313         } catch (Throwable JavaDoc th) {
314             results.add(
315                     new Validator.ResultItem(this,
316                     Validator.ResultType.ERROR,
317                     header,
318                     NbBundle.getMessage(SOAPComponentValidator.class, "SOAPHeaderValidator.Unsupported_header_use_attribute")));
319         }
320         
321         Collection JavaDoc<String JavaDoc> encodingStyles = header.getEncodingStyles();
322         if (encodingStyles != null) {
323             // This is optional. Don't verify contents at this point.
324
}
325         
326         String JavaDoc namespace = header.getNamespace();
327         if (namespace != null) {
328             // This is optional. We should verify that it is a valid URI, but
329
// I don't want to be too restrictive at this point.
330

331         }
332     }
333     
334     public void visit(SOAPAddress address) {
335         Collection JavaDoc<ResultItem> results =
336                 mValidationResult.getValidationResult();
337         
338         String JavaDoc location = address.getLocation();
339         if (location == null) {
340             results.add(
341                     new Validator.ResultItem(this,
342                     Validator.ResultType.ERROR,
343                     address,
344                     NbBundle.getMessage(SOAPComponentValidator.class, "SOAPAddressValidator.Missing_location")));
345             return;
346         }
347         
348         ////////////////////////////////////////////////////////
349
// GSR changed for Java EE Service Engine
350
// As instructed by Jerry Waldorf.
351
////////////////////////////////////////////////////////
352
if("REPLACE_WITH_ACTUAL_URL".equals(location)) {
353             return;
354         }
355         
356         ///////////////////////////////////////////////////////
357
// Check for valid tokens for default HTTP and HTTPS port
358
// Introduced to support clustering
359
////////////////////////////////////////////////////////
360

361         if (location.indexOf(HTTP_DEFAULT_PORT_TOKEN, 6) > 0) {
362             int colonIndex = -1;
363             int contextStartIndex = -1;
364             
365             if (location.startsWith("http")) {
366                 // look for ${HttpDefaultPort} token
367
colonIndex = location.indexOf(":", 6);
368                 contextStartIndex = location.indexOf("/", 7);
369                 
370                 if (HTTP_DEFAULT_PORT_TOKEN.equals(location.substring(colonIndex + 1, contextStartIndex))) {
371                     return;
372                 } else {
373                     results.add(
374                             new Validator.ResultItem(this,
375                             Validator.ResultType.ERROR,
376                             address,
377                             NbBundle.getMessage(SOAPComponentValidator.class, "SOAPAddressValidator.Unsupported_location_attribute")));
378                     return;
379                 }
380             }
381         }
382         
383         if (location.indexOf(HTTPS_DEFAULT_PORT_TOKEN, 7) > 0) {
384             int colonIndex = -1;
385             int contextStartIndex = -1;
386             
387             if (location.startsWith("https")) {
388                 // look for ${HttpDefaultPort} token
389
colonIndex = location.indexOf(":", 7);
390                 contextStartIndex = location.indexOf("/", 8);
391                 
392                 if (HTTPS_DEFAULT_PORT_TOKEN.equals(location.substring(colonIndex + 1, contextStartIndex))) {
393                     return;
394                 } else {
395                     results.add(
396                             new Validator.ResultItem(this,
397                             Validator.ResultType.ERROR,
398                             address,
399                             NbBundle.getMessage(SOAPComponentValidator.class, "SOAPAddressValidator.Unsupported_location_attribute")));
400                     return;
401                 }
402             }
403         }
404         
405         try {
406             URI JavaDoc uri = new URI JavaDoc(location);
407             String JavaDoc scheme = uri.getScheme();
408             if (!scheme.equalsIgnoreCase("http") &&
409                     !scheme.equalsIgnoreCase("https")) {
410                 return;
411             }
412             URL JavaDoc url = uri.toURL();
413         } catch (Exception JavaDoc ex) {
414             results.add(
415                     new Validator.ResultItem(this,
416                     Validator.ResultType.ERROR,
417                     address,
418                     NbBundle.getMessage(SOAPComponentValidator.class, "SOAPAddressValidator.Unsupported_location_attribute")));
419         }
420     }
421     
422     public void visit(SOAPBinding binding) {
423         Collection JavaDoc<ResultItem> results =
424                 mValidationResult.getValidationResult();
425         
426         String JavaDoc transportURI = binding.getTransportURI();
427         if (transportURI == null) {
428             results.add(
429                     new Validator.ResultItem(this,
430                     Validator.ResultType.ERROR,
431                     binding,
432                     NbBundle.getMessage(SOAPComponentValidator.class, "SOAPBindingValidator.Transport_URI_required")));
433         } else if (!transportURI.equals("http://schemas.xmlsoap.org/soap/http")) {
434             results.add(
435                     new Validator.ResultItem(this,
436                     Validator.ResultType.ERROR,
437                     binding,
438                     NbBundle.getMessage(SOAPComponentValidator.class, "SOAPBindingValidator.Unsupported_transport")));
439         }
440         
441         try {
442             SOAPBinding.Style style = binding.getStyle();
443         } catch (Throwable JavaDoc th) {
444             results.add(
445                     new Validator.ResultItem(this,
446                     Validator.ResultType.ERROR,
447                     binding,
448                     NbBundle.getMessage(SOAPComponentValidator.class, "SOAPBindingValidator.Unsupported_style_attribute")));
449         }
450     }
451     
452     public void visit(SOAPBody body) {
453         Collection JavaDoc<ResultItem> results =
454                 mValidationResult.getValidationResult();
455         
456         
457         Collection JavaDoc<String JavaDoc> encodingStyles = body.getEncodingStyles();
458         if (encodingStyles != null) {
459             // This is optional. Don't verify contents at this point.
460
}
461         
462         String JavaDoc namespace = body.getNamespace();
463         if (namespace != null) {
464             // This is optional. We should verify that it is a valid URI, but
465
// I don't want to be too restrictive at this point.
466
}
467         
468         try {
469             SOAPMessageBase.Use use = body.getUse();
470         } catch (Throwable JavaDoc th) {
471             results.add(
472                     new Validator.ResultItem(this,
473                     Validator.ResultType.ERROR,
474                     body,
475                     NbBundle.getMessage(SOAPComponentValidator.class, "SOAPBodyValidator.Unsupported_use_attribute")));
476         }
477         
478         List JavaDoc<String JavaDoc> parts = body.getParts();
479         if (parts != null) {
480             // This is optional. Don't verify contents at this point.
481
}
482         
483         // Make sure that the Message definition exists
484
/*
485         WSDLComponent bindingMessage = body.getParent();
486         System.out.println("BindingMessage: " + bindingMessage);
487         if (bindingMessage instanceof BindingInput) {
488             BindingInput bindingInput = (BindingInput)bindingMessage;
489             System.out.println("BindingInput: " + bindingInput);
490             System.out.println("BindingInput Name: "+ bindingInput.getName());
491             System.out.println("Reference: " + bindingInput.getInput());
492             Input abstractInput = bindingInput.getInput().get();
493             if (abstractInput == null) {
494                 results.add(
495                     new Validator.ResultItem(this,
496                         Validator.ResultType.ERROR,
497                         components,
498                         NbBundle.getMessage(SOAPComponentValidator.class, "SOAPBodyValidator.No_abstract_message"),
499                         ""));
500             }
501             NamedComponentReference<Message> message = abstractInput.getMessage();
502             if (message == null) {
503                 results.add(
504                     new Validator.ResultItem(this,
505                         Validator.ResultType.ERROR,
506                         components,
507                         NbBundle.getMessage(SOAPComponentValidator.class, "SOAPBodyValidator.No_abstract_message"),
508                         ""));
509             }
510          
511         } else {
512          
513         }
514          */

515     }
516     
517     public void visit(SOAPFault fault) {
518         Collection JavaDoc<ResultItem> results =
519                 mValidationResult.getValidationResult();
520         
521         String JavaDoc name = fault.getName();
522         if (name == null) {
523             results.add(
524                     new Validator.ResultItem(this,
525                     Validator.ResultType.ERROR,
526                     fault,
527                     NbBundle.getMessage(SOAPComponentValidator.class, "SOAPFaultValidator.Missing_name")));
528         }
529         
530         Collection JavaDoc<String JavaDoc> encodingStyles = fault.getEncodingStyles();
531         if (encodingStyles != null) {
532             // This is optional. Don't verify contents at this point.
533
}
534         
535         String JavaDoc namespace = fault.getNamespace();
536         if (namespace != null) {
537             // This is optional. We should verify that it is a valid URI, but
538
// I don't want to be too restrictive at this point.
539
}
540         
541         try {
542             SOAPMessageBase.Use use = fault.getUse();
543         } catch (Throwable JavaDoc th) {
544             results.add(
545                     new Validator.ResultItem(this,
546                     Validator.ResultType.ERROR,
547                     fault,
548                     NbBundle.getMessage(SOAPComponentValidator.class, "SOAPFaultValidator.Unsupported_use_attribute")));
549         }
550     }
551     
552     public void visit(SOAPHeaderFault headerFault) {
553         Collection JavaDoc<ResultItem> results =
554                 mValidationResult.getValidationResult();
555         
556         NamedComponentReference<Message> message = headerFault.getMessage();
557         if (message == null) {
558             results.add(
559                     new Validator.ResultItem(this,
560                     Validator.ResultType.ERROR,
561                     headerFault,
562                     NbBundle.getMessage(SOAPComponentValidator.class, "SOAPHeaderFaultValidator.Missing_header_fault_message")));
563         }
564         
565         String JavaDoc part = headerFault.getPart();
566         if (part == null) {
567             results.add(
568                     new Validator.ResultItem(this,
569                     Validator.ResultType.ERROR,
570                     headerFault,
571                     NbBundle.getMessage(SOAPComponentValidator.class, "SOAPHeaderFaultValidator.Missing_header_fault_part")));
572         }
573         
574         try {
575             SOAPMessageBase.Use use = headerFault.getUse();
576             if (use == null) {
577                 results.add(
578                         new Validator.ResultItem(this,
579                         Validator.ResultType.ERROR,
580                         headerFault,
581                         NbBundle.getMessage(SOAPComponentValidator.class, "SOAPHeaderFaultValidator.Missing_header_fault_use")));
582             }
583         } catch (Throwable JavaDoc th) {
584             results.add(
585                     new Validator.ResultItem(this,
586                     Validator.ResultType.ERROR,
587                     headerFault,
588                     NbBundle.getMessage(SOAPComponentValidator.class, "SOAPHeaderFaultValidator.Unsupported_header_fault_use_attribute")));
589         }
590         
591         
592         Collection JavaDoc<String JavaDoc> encodingStyles = headerFault.getEncodingStyles();
593         if (encodingStyles != null) {
594             // This is optional. Don't verify contents at this point.
595
}
596         
597         String JavaDoc namespace = headerFault.getNamespace();
598         if (namespace != null) {
599             // This is optional. We should verify that it is a valid URI, but
600
// I don't want to be too restrictive at this point.
601
}
602         
603     }
604     
605     public void visit(SOAPOperation operation) {
606         Collection JavaDoc<ResultItem> results =
607                 mValidationResult.getValidationResult();
608         
609         String JavaDoc soapActionURI = operation.getSoapAction();
610         if (soapActionURI != null) {
611             // This is fine. The URI can be anything. In reality,
612
// we should verify that this is a valid URI, but I don't want
613
// to be too restrictive.
614
}
615         
616         try {
617             SOAPBinding.Style style = operation.getStyle();
618         } catch (Throwable JavaDoc th) {
619             results.add(
620                     new Validator.ResultItem(this,
621                     Validator.ResultType.ERROR,
622                     operation,
623                     NbBundle.getMessage(SOAPComponentValidator.class, "SOAPOperationValidator.Unsupported_style_attribute")));
624         }
625     }
626 }
627
Popular Tags