You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by to...@apache.org on 2001/10/04 21:37:26 UTC

cvs commit: xml-axis/java/src/org/apache/axis/wsdl WsdlAttributes.java

tomj        01/10/04 12:37:26

  Modified:    java/src/org/apache/axis/wsdl WsdlAttributes.java
  Log:
  From Ravi Kumar [rkumar@borland.com]:
  
  Protect against missing input or output elements in binding operations.
  
  Revision  Changes    Path
  1.4       +25 -16    xml-axis/java/src/org/apache/axis/wsdl/WsdlAttributes.java
  
  Index: WsdlAttributes.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/WsdlAttributes.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WsdlAttributes.java	2001/10/03 15:30:08	1.3
  +++ WsdlAttributes.java	2001/10/04 19:37:26	1.4
  @@ -250,27 +250,36 @@
                   BindingOperation bindOp = (BindingOperation) opIterator.next();
   
                   // input
  -                Iterator inIter = bindOp.getBindingInput().getExtensibilityElements().iterator();
  -                for (; inIter.hasNext();) {
  -                    Object obj = inIter.next();
  -                    if (obj instanceof SOAPBody) {
  -                        String use = ((SOAPBody) obj).getUse();
  -                        if (use.equalsIgnoreCase("literal")) {
  -                            inputBodyType = USE_LITERAL;
  +                if (bindOp.getBindingInput() != null) {
  +                    if (bindOp.getBindingInput().getExtensibilityElements() != null) {
  +                        Iterator inIter = bindOp.getBindingInput().getExtensibilityElements().iterator();
  +                        for (; inIter.hasNext();) {
  +                            Object obj = inIter.next();
  +                            if (obj instanceof SOAPBody) {
  +                                String use = ((SOAPBody) obj).getUse();
  +                                if (use.equalsIgnoreCase("literal")) {
  +                                    inputBodyType = USE_LITERAL;
  +                                }
  +                                break;
  +                            }
                           }
  -                        break;
                       }
                   }
  +
                   // output
  -                Iterator outIter = bindOp.getBindingOutput().getExtensibilityElements().iterator();
  -                for (; outIter.hasNext();) {
  -                    Object obj = outIter.next();
  -                    if (obj instanceof SOAPBody) {
  -                        String use = ((SOAPBody) obj).getUse();
  -                        if (use.equalsIgnoreCase("literal")) {
  -                            outputBodyType = USE_LITERAL;
  +                if (bindOp.getBindingOutput() != null) {
  +                    if (bindOp.getBindingOutput().getExtensibilityElements() != null) {
  +                        Iterator outIter = bindOp.getBindingOutput().getExtensibilityElements().iterator();
  +                        for (; outIter.hasNext();) {
  +                            Object obj = outIter.next();
  +                            if (obj instanceof SOAPBody) {
  +                                String use = ((SOAPBody) obj).getUse();
  +                                if (use.equalsIgnoreCase("literal")) {
  +                                    outputBodyType = USE_LITERAL;
  +                                }
  +                                break;
  +                            }
                           }
  -                        break;
                       }
                   }