src/share/jaxws_classes/com/sun/xml/internal/ws/policy/jaxws/PolicyWSDLParserExtension.java

changeset 408
b0610cd08440
parent 368
0989ad8c0860
child 637
9c07ef4934dd
equal deleted inserted replaced
405:cc682329886b 408:b0610cd08440
23 * questions. 23 * questions.
24 */ 24 */
25 25
26 package com.sun.xml.internal.ws.policy.jaxws; 26 package com.sun.xml.internal.ws.policy.jaxws;
27 27
28 import com.sun.xml.internal.ws.api.model.wsdl.*; 28 import com.sun.xml.internal.ws.api.model.wsdl.WSDLObject;
29 import com.sun.xml.internal.ws.api.model.wsdl.editable.*;
29 import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension; 30 import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtension;
30 import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtensionContext; 31 import com.sun.xml.internal.ws.api.wsdl.parser.WSDLParserExtensionContext;
31 import com.sun.xml.internal.ws.api.policy.PolicyResolver; 32 import com.sun.xml.internal.ws.api.policy.PolicyResolver;
32 import com.sun.xml.internal.ws.resources.PolicyMessages; 33 import com.sun.xml.internal.ws.resources.PolicyMessages;
33 import com.sun.xml.internal.ws.policy.jaxws.SafePolicyReader.PolicyRecord; 34 import com.sun.xml.internal.ws.policy.jaxws.SafePolicyReader.PolicyRecord;
35 import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils; 36 import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils;
36 import com.sun.xml.internal.ws.policy.sourcemodel.PolicySourceModel; 37 import com.sun.xml.internal.ws.policy.sourcemodel.PolicySourceModel;
37 import com.sun.xml.internal.ws.policy.sourcemodel.PolicySourceModelContext; 38 import com.sun.xml.internal.ws.policy.sourcemodel.PolicySourceModelContext;
38 import com.sun.xml.internal.ws.policy.sourcemodel.wspolicy.NamespaceVersion; 39 import com.sun.xml.internal.ws.policy.sourcemodel.wspolicy.NamespaceVersion;
39 import com.sun.xml.internal.ws.policy.sourcemodel.wspolicy.XmlToken; 40 import com.sun.xml.internal.ws.policy.sourcemodel.wspolicy.XmlToken;
40 import com.sun.xml.internal.ws.model.wsdl.WSDLModelImpl;
41 import com.sun.xml.internal.ws.policy.PolicyException; 41 import com.sun.xml.internal.ws.policy.PolicyException;
42 import com.sun.xml.internal.ws.policy.PolicyMap; 42 import com.sun.xml.internal.ws.policy.PolicyMap;
43 import com.sun.xml.internal.ws.util.xml.XmlUtil; 43 import com.sun.xml.internal.ws.util.xml.XmlUtil;
44 44
45 import java.io.IOException; 45 import java.io.IOException;
52 import java.util.ArrayList; 52 import java.util.ArrayList;
53 import java.util.Collection; 53 import java.util.Collection;
54 import java.util.HashMap; 54 import java.util.HashMap;
55 import java.util.LinkedList; 55 import java.util.LinkedList;
56 import java.util.Map; 56 import java.util.Map;
57
57 import javax.xml.namespace.QName; 58 import javax.xml.namespace.QName;
58 import javax.xml.stream.XMLStreamException; 59 import javax.xml.stream.XMLStreamException;
59 import javax.xml.stream.XMLStreamReader; 60 import javax.xml.stream.XMLStreamReader;
60 import javax.xml.stream.XMLInputFactory;
61 import javax.xml.ws.WebServiceException; 61 import javax.xml.ws.WebServiceException;
62 import javax.xml.xpath.XPathFactoryConfigurationException;
63 62
64 /** 63 /**
65 * This class parses the Policy Attachments in the WSDL and creates a PolicyMap thaty captures the policies configured on 64 * This class parses the Policy Attachments in the WSDL and creates a PolicyMap thaty captures the policies configured on
66 * different PolicySubjects in the wsdl. 65 * different PolicySubjects in the wsdl.
67 * 66 *
374 } 373 }
375 } 374 }
376 } 375 }
377 376
378 @Override 377 @Override
379 public boolean portElements(final WSDLPort port, final XMLStreamReader reader) { 378 public boolean portElements(final EditableWSDLPort port, final XMLStreamReader reader) {
380 LOGGER.entering(); 379 LOGGER.entering();
381 final boolean result = processSubelement(port, reader, getHandlers4PortMap()); 380 final boolean result = processSubelement(port, reader, getHandlers4PortMap());
382 LOGGER.exiting(); 381 LOGGER.exiting();
383 return result; 382 return result;
384 } 383 }
385 384
386 @Override 385 @Override
387 public void portAttributes(final WSDLPort port, final XMLStreamReader reader) { 386 public void portAttributes(final EditableWSDLPort port, final XMLStreamReader reader) {
388 LOGGER.entering(); 387 LOGGER.entering();
389 processAttributes(port, reader, getHandlers4PortMap()); 388 processAttributes(port, reader, getHandlers4PortMap());
390 LOGGER.exiting(); 389 LOGGER.exiting();
391 } 390 }
392 391
393 @Override 392 @Override
394 public boolean serviceElements(final WSDLService service, final XMLStreamReader reader) { 393 public boolean serviceElements(final EditableWSDLService service, final XMLStreamReader reader) {
395 LOGGER.entering(); 394 LOGGER.entering();
396 final boolean result = processSubelement(service, reader, getHandlers4ServiceMap()); 395 final boolean result = processSubelement(service, reader, getHandlers4ServiceMap());
397 LOGGER.exiting(); 396 LOGGER.exiting();
398 return result; 397 return result;
399 } 398 }
400 399
401 @Override 400 @Override
402 public void serviceAttributes(final WSDLService service, final XMLStreamReader reader) { 401 public void serviceAttributes(final EditableWSDLService service, final XMLStreamReader reader) {
403 LOGGER.entering(); 402 LOGGER.entering();
404 processAttributes(service, reader, getHandlers4ServiceMap()); 403 processAttributes(service, reader, getHandlers4ServiceMap());
405 LOGGER.exiting(); 404 LOGGER.exiting();
406 } 405 }
407 406
422 LOGGER.exiting(); 421 LOGGER.exiting();
423 return false; 422 return false;
424 } 423 }
425 424
426 @Override 425 @Override
427 public boolean bindingElements(final WSDLBoundPortType binding, final XMLStreamReader reader) { 426 public boolean bindingElements(final EditableWSDLBoundPortType binding, final XMLStreamReader reader) {
428 LOGGER.entering(); 427 LOGGER.entering();
429 final boolean result = processSubelement(binding, reader, getHandlers4BindingMap()); 428 final boolean result = processSubelement(binding, reader, getHandlers4BindingMap());
430 LOGGER.exiting(); 429 LOGGER.exiting();
431 return result; 430 return result;
432 } 431 }
433 432
434 @Override 433 @Override
435 public void bindingAttributes(final WSDLBoundPortType binding, final XMLStreamReader reader) { 434 public void bindingAttributes(final EditableWSDLBoundPortType binding, final XMLStreamReader reader) {
436 LOGGER.entering(); 435 LOGGER.entering();
437 processAttributes(binding, reader, getHandlers4BindingMap()); 436 processAttributes(binding, reader, getHandlers4BindingMap());
438 LOGGER.exiting(); 437 LOGGER.exiting();
439 } 438 }
440 439
441 @Override 440 @Override
442 public boolean portTypeElements(final WSDLPortType portType, final XMLStreamReader reader) { 441 public boolean portTypeElements(final EditableWSDLPortType portType, final XMLStreamReader reader) {
443 LOGGER.entering(); 442 LOGGER.entering();
444 final boolean result = processSubelement(portType, reader, getHandlers4PortTypeMap()); 443 final boolean result = processSubelement(portType, reader, getHandlers4PortTypeMap());
445 LOGGER.exiting(); 444 LOGGER.exiting();
446 return result; 445 return result;
447 } 446 }
448 447
449 @Override 448 @Override
450 public void portTypeAttributes(final WSDLPortType portType, final XMLStreamReader reader) { 449 public void portTypeAttributes(final EditableWSDLPortType portType, final XMLStreamReader reader) {
451 LOGGER.entering(); 450 LOGGER.entering();
452 processAttributes(portType, reader, getHandlers4PortTypeMap()); 451 processAttributes(portType, reader, getHandlers4PortTypeMap());
453 LOGGER.exiting(); 452 LOGGER.exiting();
454 } 453 }
455 454
456 @Override 455 @Override
457 public boolean portTypeOperationElements(final WSDLOperation operation, final XMLStreamReader reader) { 456 public boolean portTypeOperationElements(final EditableWSDLOperation operation, final XMLStreamReader reader) {
458 LOGGER.entering(); 457 LOGGER.entering();
459 final boolean result = processSubelement(operation, reader, getHandlers4OperationMap()); 458 final boolean result = processSubelement(operation, reader, getHandlers4OperationMap());
460 LOGGER.exiting(); 459 LOGGER.exiting();
461 return result; 460 return result;
462 } 461 }
463 462
464 @Override 463 @Override
465 public void portTypeOperationAttributes(final WSDLOperation operation, final XMLStreamReader reader) { 464 public void portTypeOperationAttributes(final EditableWSDLOperation operation, final XMLStreamReader reader) {
466 LOGGER.entering(); 465 LOGGER.entering();
467 processAttributes(operation, reader, getHandlers4OperationMap()); 466 processAttributes(operation, reader, getHandlers4OperationMap());
468 LOGGER.exiting(); 467 LOGGER.exiting();
469 } 468 }
470 469
471 @Override 470 @Override
472 public boolean bindingOperationElements(final WSDLBoundOperation boundOperation, final XMLStreamReader reader) { 471 public boolean bindingOperationElements(final EditableWSDLBoundOperation boundOperation, final XMLStreamReader reader) {
473 LOGGER.entering(); 472 LOGGER.entering();
474 final boolean result = processSubelement(boundOperation, reader, getHandlers4BoundOperationMap()); 473 final boolean result = processSubelement(boundOperation, reader, getHandlers4BoundOperationMap());
475 LOGGER.exiting(); 474 LOGGER.exiting();
476 return result; 475 return result;
477 } 476 }
478 477
479 @Override 478 @Override
480 public void bindingOperationAttributes(final WSDLBoundOperation boundOperation, final XMLStreamReader reader) { 479 public void bindingOperationAttributes(final EditableWSDLBoundOperation boundOperation, final XMLStreamReader reader) {
481 LOGGER.entering(); 480 LOGGER.entering();
482 processAttributes(boundOperation, reader, getHandlers4BoundOperationMap()); 481 processAttributes(boundOperation, reader, getHandlers4BoundOperationMap());
483 LOGGER.exiting(); 482 LOGGER.exiting();
484 } 483 }
485 484
486 @Override 485 @Override
487 public boolean messageElements(final WSDLMessage msg, final XMLStreamReader reader) { 486 public boolean messageElements(final EditableWSDLMessage msg, final XMLStreamReader reader) {
488 LOGGER.entering(); 487 LOGGER.entering();
489 final boolean result = processSubelement(msg, reader, getHandlers4MessageMap()); 488 final boolean result = processSubelement(msg, reader, getHandlers4MessageMap());
490 LOGGER.exiting(); 489 LOGGER.exiting();
491 return result; 490 return result;
492 } 491 }
493 492
494 @Override 493 @Override
495 public void messageAttributes(final WSDLMessage msg, final XMLStreamReader reader) { 494 public void messageAttributes(final EditableWSDLMessage msg, final XMLStreamReader reader) {
496 LOGGER.entering(); 495 LOGGER.entering();
497 processAttributes(msg, reader, getHandlers4MessageMap()); 496 processAttributes(msg, reader, getHandlers4MessageMap());
498 LOGGER.exiting(); 497 LOGGER.exiting();
499 } 498 }
500 499
501 @Override 500 @Override
502 public boolean portTypeOperationInputElements(final WSDLInput input, final XMLStreamReader reader) { 501 public boolean portTypeOperationInputElements(final EditableWSDLInput input, final XMLStreamReader reader) {
503 LOGGER.entering(); 502 LOGGER.entering();
504 final boolean result = processSubelement(input, reader, getHandlers4InputMap()); 503 final boolean result = processSubelement(input, reader, getHandlers4InputMap());
505 LOGGER.exiting(); 504 LOGGER.exiting();
506 return result; 505 return result;
507 } 506 }
508 507
509 @Override 508 @Override
510 public void portTypeOperationInputAttributes(final WSDLInput input, final XMLStreamReader reader) { 509 public void portTypeOperationInputAttributes(final EditableWSDLInput input, final XMLStreamReader reader) {
511 LOGGER.entering(); 510 LOGGER.entering();
512 processAttributes(input, reader, getHandlers4InputMap()); 511 processAttributes(input, reader, getHandlers4InputMap());
513 LOGGER.exiting(); 512 LOGGER.exiting();
514 } 513 }
515 514
516 515
517 @Override 516 @Override
518 public boolean portTypeOperationOutputElements(final WSDLOutput output, final XMLStreamReader reader) { 517 public boolean portTypeOperationOutputElements(final EditableWSDLOutput output, final XMLStreamReader reader) {
519 LOGGER.entering(); 518 LOGGER.entering();
520 final boolean result = processSubelement(output, reader, getHandlers4OutputMap()); 519 final boolean result = processSubelement(output, reader, getHandlers4OutputMap());
521 LOGGER.exiting(); 520 LOGGER.exiting();
522 return result; 521 return result;
523 } 522 }
524 523
525 @Override 524 @Override
526 public void portTypeOperationOutputAttributes(final WSDLOutput output, final XMLStreamReader reader) { 525 public void portTypeOperationOutputAttributes(final EditableWSDLOutput output, final XMLStreamReader reader) {
527 LOGGER.entering(); 526 LOGGER.entering();
528 processAttributes(output, reader, getHandlers4OutputMap()); 527 processAttributes(output, reader, getHandlers4OutputMap());
529 LOGGER.exiting(); 528 LOGGER.exiting();
530 } 529 }
531 530
532 531
533 @Override 532 @Override
534 public boolean portTypeOperationFaultElements(final WSDLFault fault, final XMLStreamReader reader) { 533 public boolean portTypeOperationFaultElements(final EditableWSDLFault fault, final XMLStreamReader reader) {
535 LOGGER.entering(); 534 LOGGER.entering();
536 final boolean result = processSubelement(fault, reader, getHandlers4FaultMap()); 535 final boolean result = processSubelement(fault, reader, getHandlers4FaultMap());
537 LOGGER.exiting(); 536 LOGGER.exiting();
538 return result; 537 return result;
539 } 538 }
540 539
541 @Override 540 @Override
542 public void portTypeOperationFaultAttributes(final WSDLFault fault, final XMLStreamReader reader) { 541 public void portTypeOperationFaultAttributes(final EditableWSDLFault fault, final XMLStreamReader reader) {
543 LOGGER.entering(); 542 LOGGER.entering();
544 processAttributes(fault, reader, getHandlers4FaultMap()); 543 processAttributes(fault, reader, getHandlers4FaultMap());
545 LOGGER.exiting(); 544 LOGGER.exiting();
546 } 545 }
547 546
548 @Override 547 @Override
549 public boolean bindingOperationInputElements(final WSDLBoundOperation operation, final XMLStreamReader reader) { 548 public boolean bindingOperationInputElements(final EditableWSDLBoundOperation operation, final XMLStreamReader reader) {
550 LOGGER.entering(); 549 LOGGER.entering();
551 final boolean result = processSubelement(operation, reader, getHandlers4BindingInputOpMap()); 550 final boolean result = processSubelement(operation, reader, getHandlers4BindingInputOpMap());
552 LOGGER.exiting(); 551 LOGGER.exiting();
553 return result; 552 return result;
554 } 553 }
555 554
556 @Override 555 @Override
557 public void bindingOperationInputAttributes(final WSDLBoundOperation operation, final XMLStreamReader reader) { 556 public void bindingOperationInputAttributes(final EditableWSDLBoundOperation operation, final XMLStreamReader reader) {
558 LOGGER.entering(); 557 LOGGER.entering();
559 processAttributes(operation, reader, getHandlers4BindingInputOpMap()); 558 processAttributes(operation, reader, getHandlers4BindingInputOpMap());
560 LOGGER.exiting(); 559 LOGGER.exiting();
561 } 560 }
562 561
563 562
564 @Override 563 @Override
565 public boolean bindingOperationOutputElements(final WSDLBoundOperation operation, final XMLStreamReader reader) { 564 public boolean bindingOperationOutputElements(final EditableWSDLBoundOperation operation, final XMLStreamReader reader) {
566 LOGGER.entering(); 565 LOGGER.entering();
567 final boolean result = processSubelement(operation, reader, getHandlers4BindingOutputOpMap()); 566 final boolean result = processSubelement(operation, reader, getHandlers4BindingOutputOpMap());
568 LOGGER.exiting(); 567 LOGGER.exiting();
569 return result; 568 return result;
570 } 569 }
571 570
572 @Override 571 @Override
573 public void bindingOperationOutputAttributes(final WSDLBoundOperation operation, final XMLStreamReader reader) { 572 public void bindingOperationOutputAttributes(final EditableWSDLBoundOperation operation, final XMLStreamReader reader) {
574 LOGGER.entering(); 573 LOGGER.entering();
575 processAttributes(operation, reader, getHandlers4BindingOutputOpMap()); 574 processAttributes(operation, reader, getHandlers4BindingOutputOpMap());
576 LOGGER.exiting(); 575 LOGGER.exiting();
577 } 576 }
578 577
579 @Override 578 @Override
580 public boolean bindingOperationFaultElements(final WSDLBoundFault fault, final XMLStreamReader reader) { 579 public boolean bindingOperationFaultElements(final EditableWSDLBoundFault fault, final XMLStreamReader reader) {
581 LOGGER.entering(); 580 LOGGER.entering();
582 final boolean result = processSubelement(fault, reader, getHandlers4BindingFaultOpMap()); 581 final boolean result = processSubelement(fault, reader, getHandlers4BindingFaultOpMap());
583 LOGGER.exiting(result); 582 LOGGER.exiting(result);
584 return result; 583 return result;
585 } 584 }
586 585
587 @Override 586 @Override
588 public void bindingOperationFaultAttributes(final WSDLBoundFault fault, final XMLStreamReader reader) { 587 public void bindingOperationFaultAttributes(final EditableWSDLBoundFault fault, final XMLStreamReader reader) {
589 LOGGER.entering(); 588 LOGGER.entering();
590 processAttributes(fault, reader, getHandlers4BindingFaultOpMap()); 589 processAttributes(fault, reader, getHandlers4BindingFaultOpMap());
591 LOGGER.exiting(); 590 LOGGER.exiting();
592 } 591 }
593 592
699 try { 698 try {
700 // messageSet holds the handlers for all wsdl:message elements. There 699 // messageSet holds the handlers for all wsdl:message elements. There
701 // may otherwise be multiple entries for policies that are contained 700 // may otherwise be multiple entries for policies that are contained
702 // by fault messages. 701 // by fault messages.
703 HashSet<BuilderHandlerMessageScope> messageSet = new HashSet<BuilderHandlerMessageScope>(); 702 HashSet<BuilderHandlerMessageScope> messageSet = new HashSet<BuilderHandlerMessageScope>();
704 for (WSDLService service : context.getWSDLModel().getServices().values()) { 703 for (EditableWSDLService service : context.getWSDLModel().getServices().values()) {
705 if (getHandlers4ServiceMap().containsKey(service)) { 704 if (getHandlers4ServiceMap().containsKey(service)) {
706 getPolicyMapBuilder().registerHandler(new BuilderHandlerServiceScope( 705 getPolicyMapBuilder().registerHandler(new BuilderHandlerServiceScope(
707 getPolicyURIs(getHandlers4ServiceMap().get(service),modelContext) 706 getPolicyURIs(getHandlers4ServiceMap().get(service),modelContext)
708 ,getPolicyModels() 707 ,getPolicyModels()
709 ,service 708 ,service
710 ,service.getName())); 709 ,service.getName()));
711 } 710 }
712 // end service scope 711 // end service scope
713 712
714 for (WSDLPort port : service.getPorts()) { 713 for (EditableWSDLPort port : service.getPorts()) {
715 if (getHandlers4PortMap().containsKey(port)) { 714 if (getHandlers4PortMap().containsKey(port)) {
716 getPolicyMapBuilder().registerHandler( 715 getPolicyMapBuilder().registerHandler(
717 new BuilderHandlerEndpointScope( 716 new BuilderHandlerEndpointScope(
718 getPolicyURIs(getHandlers4PortMap().get(port),modelContext) 717 getPolicyURIs(getHandlers4PortMap().get(port),modelContext)
719 ,getPolicyModels() 718 ,getPolicyModels()
745 ,service.getName() 744 ,service.getName()
746 ,port.getName())); 745 ,port.getName()));
747 } // endif handler for port type 746 } // endif handler for port type
748 // end endpoint scope 747 // end endpoint scope
749 748
750 for (WSDLBoundOperation boundOperation : port.getBinding().getBindingOperations()) { 749 for (EditableWSDLBoundOperation boundOperation : port.getBinding().getBindingOperations()) {
751 750
752 final WSDLOperation operation = boundOperation.getOperation(); 751 final EditableWSDLOperation operation = boundOperation.getOperation();
753 final QName operationName = new QName(boundOperation.getBoundPortType().getName().getNamespaceURI(), boundOperation.getName().getLocalPart()); 752 final QName operationName = new QName(boundOperation.getBoundPortType().getName().getNamespaceURI(), boundOperation.getName().getLocalPart());
754 // We store the message and portType/operation under the same namespace as the binding/operation so that we can match them up later 753 // We store the message and portType/operation under the same namespace as the binding/operation so that we can match them up later
755 if ( // handler for operation scope -- by boundOperation 754 if ( // handler for operation scope -- by boundOperation
756 getHandlers4BoundOperationMap().containsKey(boundOperation)) { 755 getHandlers4BoundOperationMap().containsKey(boundOperation)) {
757 getPolicyMapBuilder() 756 getPolicyMapBuilder()
776 ,port.getName() 775 ,port.getName()
777 ,operationName)); 776 ,operationName));
778 } // endif for portType:operation scope 777 } // endif for portType:operation scope
779 // end operation scope 778 // end operation scope
780 779
781 final WSDLInput input = operation.getInput(); 780 final EditableWSDLInput input = operation.getInput();
782 if (null!=input) { 781 if (null!=input) {
783 WSDLMessage inputMsg = input.getMessage(); 782 EditableWSDLMessage inputMsg = input.getMessage();
784 if (inputMsg != null && getHandlers4MessageMap().containsKey(inputMsg)) { 783 if (inputMsg != null && getHandlers4MessageMap().containsKey(inputMsg)) {
785 messageSet.add(new BuilderHandlerMessageScope( 784 messageSet.add(new BuilderHandlerMessageScope(
786 getPolicyURIs( 785 getPolicyURIs(
787 getHandlers4MessageMap().get(inputMsg), modelContext) 786 getHandlers4MessageMap().get(inputMsg), modelContext)
788 ,getPolicyModels() 787 ,getPolicyModels()
823 ,operationName 822 ,operationName
824 ,null)); 823 ,null));
825 } // endif portType op input msg 824 } // endif portType op input msg
826 // end input message scope 825 // end input message scope
827 826
828 final WSDLOutput output = operation.getOutput(); 827 final EditableWSDLOutput output = operation.getOutput();
829 if (null!=output) { 828 if (null!=output) {
830 WSDLMessage outputMsg = output.getMessage(); 829 EditableWSDLMessage outputMsg = output.getMessage();
831 if (outputMsg != null && getHandlers4MessageMap().containsKey(outputMsg)) { 830 if (outputMsg != null && getHandlers4MessageMap().containsKey(outputMsg)) {
832 messageSet.add(new BuilderHandlerMessageScope( 831 messageSet.add(new BuilderHandlerMessageScope(
833 getPolicyURIs( 832 getPolicyURIs(
834 getHandlers4MessageMap().get(outputMsg),modelContext) 833 getHandlers4MessageMap().get(outputMsg),modelContext)
835 ,getPolicyModels() 834 ,getPolicyModels()
870 ,operationName 869 ,operationName
871 ,null)); 870 ,null));
872 } // endif portType op output msg 871 } // endif portType op output msg
873 // end output message scope 872 // end output message scope
874 873
875 for (WSDLBoundFault boundFault : boundOperation.getFaults()) { 874 for (EditableWSDLBoundFault boundFault : boundOperation.getFaults()) {
876 final WSDLFault fault = boundFault.getFault(); 875 final EditableWSDLFault fault = boundFault.getFault();
877 876
878 // this shouldn't happen ususally, 877 // this shouldn't happen ususally,
879 // but since this scenario tested in lagacy tests, dont' fail here 878 // but since this scenario tested in lagacy tests, dont' fail here
880 if (fault == null) { 879 if (fault == null) {
881 LOGGER.warning(PolicyMessages.WSP_1021_FAULT_NOT_BOUND(boundFault.getName())); 880 LOGGER.warning(PolicyMessages.WSP_1021_FAULT_NOT_BOUND(boundFault.getName()));
882 continue; 881 continue;
883 } 882 }
884 883
885 final WSDLMessage faultMessage = fault.getMessage(); 884 final EditableWSDLMessage faultMessage = fault.getMessage();
886 final QName faultName = new QName(boundOperation.getBoundPortType().getName().getNamespaceURI(), boundFault.getName()); 885 final QName faultName = new QName(boundOperation.getBoundPortType().getName().getNamespaceURI(), boundFault.getName());
887 // We store the message and portType/fault under the same namespace as the binding/fault so that we can match them up later 886 // We store the message and portType/fault under the same namespace as the binding/fault so that we can match them up later
888 if (faultMessage != null && getHandlers4MessageMap().containsKey(faultMessage)) { 887 if (faultMessage != null && getHandlers4MessageMap().containsKey(faultMessage)) {
889 messageSet.add( 888 messageSet.add(
890 new BuilderHandlerMessageScope( 889 new BuilderHandlerMessageScope(
946 945
947 // time to read possible config file and do alternative selection (on client side) 946 // time to read possible config file and do alternative selection (on client side)
948 @Override 947 @Override
949 public void postFinished(final WSDLParserExtensionContext context) { 948 public void postFinished(final WSDLParserExtensionContext context) {
950 // finally register the PolicyMap on the WSDLModel 949 // finally register the PolicyMap on the WSDLModel
951 WSDLModel wsdlModel = context.getWSDLModel(); 950 EditableWSDLModel wsdlModel = context.getWSDLModel();
952 PolicyMap effectiveMap; 951 PolicyMap effectiveMap;
953 try { 952 try {
954 if(context.isClientSide()) 953 if(context.isClientSide())
955 effectiveMap = context.getPolicyResolver().resolve(new PolicyResolver.ClientContext(policyBuilder.getPolicyMap(),context.getContainer())); 954 effectiveMap = context.getPolicyResolver().resolve(new PolicyResolver.ClientContext(policyBuilder.getPolicyMap(),context.getContainer()));
956 else 955 else
957 effectiveMap = context.getPolicyResolver().resolve(new PolicyResolver.ServerContext(policyBuilder.getPolicyMap(), context.getContainer(),null)); 956 effectiveMap = context.getPolicyResolver().resolve(new PolicyResolver.ServerContext(policyBuilder.getPolicyMap(), context.getContainer(),null));
958 ((WSDLModelImpl) wsdlModel).setPolicyMap(effectiveMap); 957 wsdlModel.setPolicyMap(effectiveMap);
959 } catch (PolicyException e) { 958 } catch (PolicyException e) {
960 LOGGER.logSevereException(e); 959 LOGGER.logSevereException(e);
961 throw LOGGER.logSevereException(new WebServiceException(PolicyMessages.WSP_1007_POLICY_EXCEPTION_WHILE_FINISHING_PARSING_WSDL(), e)); 960 throw LOGGER.logSevereException(new WebServiceException(PolicyMessages.WSP_1007_POLICY_EXCEPTION_WHILE_FINISHING_PARSING_WSDL(), e));
962 } 961 }
963 try { 962 try {

mercurial