Package org.jboss.ws

Examples of org.jboss.ws.WSException


         XOPContext.setXOPMessage(true);
      }
      catch (SOAPException e)
      {
         throw new WSException("Failed to create XOP include element", e);
      }

   }
View Full Code Here


         data = bout.toByteArray();

      }
      catch (Exception e)
      {
         throw new WSException("Failed to inline XOP data", e);
      }

      // create base64 contents
      String base64 = SimpleTypeBindings.marshalBase64(data);
      parent.removeChild(xopIncludeElement);
      parent.setValue(base64);
      parent.setUserData(NS_XOP_JBOSSWS_CONTENT_TYPE, contentType, null);

      if (log.isDebugEnabled())
         log.debug("Created base64 representation for content-type " + contentType);

      // cleanup the attachment part
      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();

      if (cid.startsWith("cid:"))
         cid = cid.substring(4);
      cid = '<' + cid + '>';

      AttachmentPart removedPart = soapMessage.removeAttachmentByContentId(cid);
      if (null == removedPart)
         throw new WSException("Unable to remove attachment part " + cid);

      if (log.isDebugEnabled())
         log.debug("Removed attachment part " + cid);

      // leave soap object model in a valid state
View Full Code Here

         cid = cid.substring(4);
      cid = '<' + cid + '>';

      AttachmentPart part = soapMessage.getAttachmentByContentId(cid);
      if (part == null)
         throw new WSException("Cannot find attachment part for: " + cid);

      return part;
   }
View Full Code Here

            return handleSimpleType(simple.getItemType());
         case XSSimpleTypeDefinition.VARIETY_UNION:
            XSObjectList list = simple.getMemberTypes();
            if (list.getLength() > 0)
               return handleSimpleType((XSSimpleTypeDefinition)list.item(0));
            throw new WSException("Empty union type not expected");
         case XSSimpleTypeDefinition.VARIETY_ABSENT:
            throw new WSException("Absent variety is not supported in simple types");
      }

      XSTypeDefinition base = simple.getBaseType();
      while (!Constants.NS_SCHEMA_XSD.equals(base.getNamespace()))
         base = base.getBaseType();

      if (!(base instanceof XSSimpleTypeDefinition))
         throw new WSException("Expected base type to be a simple type");

      return new QName(base.getNamespace(), base.getName());
   }
View Full Code Here

   public XSModel parseSchema(String schemaLoc)
   {
      XSLoader xsloader = getXSLoader();
      XSModel xsModel = xsloader.loadURI(schemaLoc);
      if (xsModel == null)
         throw new WSException("Cannot parse schema: " + schemaLoc);
      return xsModel;
   }
View Full Code Here

   {
      if (xsmodel == null)
         return true;
      String targetNS = getTargetNamespace(xsmodel);
      if (targetNS == null)
         throw new WSException("Target Namespace of xsmodel is null");
      XSNamedMap tmap = xsmodel.getComponentsByNamespace(XSConstants.TYPE_DEFINITION, targetNS);
      XSNamedMap emap = xsmodel.getComponentsByNamespace(XSConstants.ELEMENT_DECLARATION, targetNS);

      if (tmap != null && tmap.getLength() > 0)
         return false;
View Full Code Here

   public boolean isEmptySchema(XSModel xsmodel, String namespace)
   {
      if (xsmodel == null)
         return true;
      if (namespace == null)
         throw new WSException("Target Namespace of xsmodel is null");
      XSNamedMap tmap = xsmodel.getComponentsByNamespace(XSConstants.TYPE_DEFINITION, namespace);
      XSNamedMap emap = xsmodel.getComponentsByNamespace(XSConstants.ELEMENT_DECLARATION, namespace);

      if (tmap != null && tmap.getLength() > 0)
         return false;
View Full Code Here

      {
         throw rte;
      }
      catch (Exception ex)
      {
         throw new WSException("Cannot load handler: " + className, ex);
      }
   }
View Full Code Here

      else
      {
         EndpointMetaData epMetaData = client.getEndpointMetaData();
         OperationMetaData opMetaData = epMetaData.getOperation(method);
         if (opMetaData == null)
            throw new WSException("Cannot obtain operation meta data for: " + methodName);

         QName opName = opMetaData.getQName();

         if (log.isTraceEnabled())
            log.trace("Invoke method: " + method + opMetaData);
View Full Code Here

   {
      Object retObj = client.invoke(opName, args, resContext);
      if (retObj != null)
      {
         if (retType == null)
            throw new WSException("Return value not supported by: " + opName);

         if (JavaUtils.isPrimitive(retType))
            retObj = JavaUtils.getPrimitiveValueArray(retObj);
      }
      return retObj;
View Full Code Here

TOP

Related Classes of org.jboss.ws.WSException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.