Package org.jboss.ws

Examples of org.jboss.ws.WSException


            {
               out.write(bytes);
            }
            catch (IOException e)
            {
               throw new WSException("Failed to convert " + obj.getClass());
            }
         }
         else
         {
            throw new WSException("Unable to convert " + obj.getClass());
         }
      }
View Full Code Here


            {
               IOUtils.copyStream(out, (InputStream)obj);
            }
            catch (IOException e)
            {
               throw new WSException("Failed to convert " + obj.getClass());
            }
         }
      }
View Full Code Here

         {
            epMetaData.setServiceEndpointInterfaceName(seiMapping.getServiceEndpointInterface());

            seiMethodMapping = seiMapping.getServiceEndpointMethodMappingByWsdlOperation(opName);
            if (seiMethodMapping == null)
               throw new WSException("Cannot obtain method mapping for: " + opName);

            javaName = seiMethodMapping.getJavaMethodName();
         }

         OperationMetaData opMetaData = new OperationMetaData(epMetaData, opQName, javaName);
View Full Code Here

            pos = paramMapping.getParamPosition();
            mapped = true;
         }
         else if (!optional)
         {
            throw new WSException("Cannot obtain method parameter mapping for message part '" + partName + "' in wsdl operation: "
                  + seiMethodMapping.getWsdlOperation());
         }
      }

      // For now we ignore unlisted headers with no mapping information
      if (!mapped && optional)
         return null;

      JavaWsdlMapping javaWsdlMapping = opMetaData.getEndpointMetaData().getServiceMetaData().getJavaWsdlMapping();
      if (javaTypeName == null && javaWsdlMapping != null)
      {
         String packageName = javaWsdlMapping.getPackageNameForNamespaceURI(xmlType.getNamespaceURI());
         if (packageName != null)
         {
            javaTypeName = packageName + "." + xmlType.getLocalPart();
            log.warn("Guess java type from package mapping: [xmlType=" + xmlType + ",javaType=" + javaTypeName + "]");
         }
      }

      if (javaTypeName == null)
         throw new WSException("Cannot obtain java type mapping for: " + xmlType);

      ParameterMetaData inMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType, javaTypeName);
      inMetaData.setPartName(partName);
      inMetaData.setIndex(pos);
      opMetaData.addParameter(inMetaData);
View Full Code Here

            log.warn("Guess java type from package mapping: [xmlType=" + xmlType + ",javaType=" + javaTypeName + "]");
         }
      }

      if (javaTypeName == null)
         throw new WSException("Cannot obtain java type mapping for: " + xmlType);

      ParameterMetaData outMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType, javaTypeName);
      outMetaData.setPartName(partName);

      if (hasReturnMapping)
View Full Code Here

   {
      log.trace("buildParameterMetaDataRpc: " + opMetaData.getQName());

      WSDLBindingOperation bindingOperation = wsdlOperation.getBindingOperation();
      if (bindingOperation == null)
         throw new WSException("Could not locate binding operation for:" + opMetaData.getQName());

      // RPC has one input
      WSDLInterfaceOperationInput input = wsdlOperation.getInputs()[0];
      int wsdlPosition = 0;
      for (WSDLRPCPart part : input.getChildParts())
      {
         QName xmlType = part.getType();
         String partName = part.getName();
         QName xmlName = new QName(partName);

         ParameterMetaData pmd = buildInputParameter(opMetaData, wsdlOperation, seiMethodMapping, typeMapping, partName, xmlName, xmlType, wsdlPosition++, false);

         setupXOPAttachmentParameter(wsdlOperation, pmd);
         setupSOAPArrayParameter(pmd);
      }

      wsdlPosition = processBindingParameters(opMetaData, wsdlOperation, seiMethodMapping, typeMapping, bindingOperation, wsdlPosition);

      WSDLInterfaceOperationOutput[] outputs = wsdlOperation.getOutputs();
      if (outputs.length > 0)
      {
         WSDLInterfaceOperationOutput output = outputs[0];
         for (WSDLRPCPart part : output.getChildParts())
         {
            String partName = part.getName();

            ParameterMetaData outMetaData = opMetaData.getParameter(new QName(partName));
            if (outMetaData != null)
            {
               outMetaData.setMode(ParameterMode.INOUT);
            }
            else
            {
               QName xmlName = new QName(partName);
               QName xmlType = part.getType();

               ParameterMetaData pmd = buildOutputParameter(opMetaData, wsdlOperation, seiMethodMapping, wsdlPosition, partName, xmlName, xmlType, typeMapping, false);
               if (opMetaData.getReturnParameter() != pmd)
                  wsdlPosition++;

               setupXOPAttachmentParameter(wsdlOperation, pmd);
               setupSOAPArrayParameter(pmd);
            }
         }

         processBindingOutputParameters(opMetaData, wsdlOperation, seiMethodMapping, typeMapping, bindingOperation, wsdlPosition);
      }
      else if (wsdlOperation.getPattern() != Constants.WSDL20_PATTERN_IN_ONLY)
      {
         throw new WSException("RPC style was missing an output, and was not an IN-ONLY MEP.");
      }
   }
View Full Code Here

      TypeMappingMetaData typeMetaData = typesMetaData.getTypeMappingByXMLType(xmlType);
      if (typeMetaData != null)
         javaTypeName = typeMetaData.getJavaTypeName();

      if (javaTypeName == null)
         throw new WSException("Cannot obtain java type mapping for: " + xmlType);

      // Check if we need to wrap the parameters
      boolean isWrapped = isWrapped(seiMethodMapping, javaTypeName);
      operation.getEndpointMetaData().setParameterStyle(isWrapped ? ParameterStyle.WRAPPED : ParameterStyle.BARE);

      ParameterMetaData inMetaData = new ParameterMetaData(operation, xmlName, xmlType, javaTypeName);
      operation.addParameter(inMetaData);

      // Set the variable names
      if (inMetaData.getOperationMetaData().isDocumentWrapped())
      {
         if (seiMethodMapping == null)
            throw new IllegalArgumentException("Cannot wrap parameters without SEI method mapping");

         ServiceEndpointInterfaceMapping seiMapping = seiMethodMapping.getServiceEndpointInterfaceMapping();
         JavaXmlTypeMapping javaXmlTypeMapping = seiMapping.getJavaWsdlMapping().getTypeMappingForQName(xmlType);
         if (javaXmlTypeMapping == null)
            throw new WSException("Cannot obtain java/xml type mapping for: " + xmlType);

         Map<String, String> variableMap = createVariableMappingMap(javaXmlTypeMapping.getVariableMappings());
         for (MethodParamPartsMapping partMapping : seiMethodMapping.getMethodParamPartsMappings())
         {
            WsdlMessageMapping wsdlMessageMapping = partMapping.getWsdlMessageMapping();
View Full Code Here

      TypesMetaData typesMetaData = opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
      if (typesMetaData.getTypeMappingByXMLType(xmlType) != null)
         javaTypeName = typesMetaData.getTypeMappingByXMLType(xmlType).getJavaTypeName();

      if (javaTypeName == null)
         throw new WSException("Cannot obtain java/xml type mapping for: " + xmlType);

      ParameterMetaData outMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType, javaTypeName);

      boolean hasReturnMapping = true;
      if (opMetaData.isDocumentWrapped())
      {
         if (seiMethodMapping == null)
            throw new IllegalArgumentException("Cannot wrap parameters without SEI method mapping");

         WsdlReturnValueMapping returnValueMapping = seiMethodMapping.getWsdlReturnValueMapping();
         if (returnValueMapping != null)
         {
            ServiceEndpointInterfaceMapping seiMapping = seiMethodMapping.getServiceEndpointInterfaceMapping();
            JavaWsdlMapping javaWsdlMapping = seiMapping.getJavaWsdlMapping();
            JavaXmlTypeMapping javaXmlTypeMapping = javaWsdlMapping.getTypeMappingForQName(xmlType);
            if (javaXmlTypeMapping == null)
               throw new WSException("Cannot obtain java/xml type mapping for: " + xmlType);

            Map<String, String> map = createVariableMappingMap(javaXmlTypeMapping.getVariableMappings());
            if (map.size() > 0)
            {
               String elementName = returnValueMapping.getWsdlMessagePartName();
               String variable = map.get(elementName);
               if (variable == null)
                  throw new IllegalArgumentException("Could not determine variable name for element: " + elementName);

               String wrappedType = returnValueMapping.getMethodReturnValue();
               QName element = new QName(elementName);
               WrappedParameter wrappedParameter = new WrappedParameter(element, wrappedType, variable, WrappedParameter.RETURN);
               wrappedResponseParameters.add(0, wrappedParameter);
            }
         }

         outMetaData.setWrappedParameters(wrappedResponseParameters);
      }
      else
      {
         if (seiMethodMapping != null)
         {
            MethodParamPartsMapping part = seiMethodMapping.getMethodParamPartsMappingByPartName(opOutput.getPartName());
            String mode = null;
            if (part != null)
            {
               WsdlMessageMapping wsdlMessageMapping = part.getWsdlMessageMapping();
               mode = wsdlMessageMapping.getParameterMode();
            }
            if ("INOUT".equals(mode))
            {
               ParameterMetaData inMetaData = opMetaData.getParameter(xmlName);
               if (inMetaData != null)
               {
                  inMetaData.setMode(ParameterMode.INOUT);
                  return wsdlPosition;
               }

               throw new WSException("Could not update IN parameter to be INOUT, as indicated in the mapping: " + opOutput.getPartName());
            }
            // It's potentialy possible that an input parameter could exist with the same part name
            else if ("OUT".equals(mode))
            {
               hasReturnMapping = false;
View Full Code Here

   {
      log.trace("buildParameterMetaDataDoc: " + opMetaData.getQName());

      WSDLBindingOperation bindingOperation = wsdlOperation.getBindingOperation();
      if (bindingOperation == null)
         throw new WSException("Could not locate binding operation for:" + bindingOperation);

      List<WrappedParameter> wrappedParameters = new ArrayList<WrappedParameter>();
      List<WrappedParameter> wrappedResponseParameters = new ArrayList<WrappedParameter>();

      int wsdlPosition = 0;
View Full Code Here

                  Source xmlFragment = new DOMSource(deElement);
                  DeserializerSupport des = (DeserializerSupport)desFactory.getDeserializer();
                  Object userEx = des.deserialize(xmlName, xmlType, xmlFragment, serContext);
                  if (userEx == null || (userEx instanceof Exception) == false)
                     throw new WSException("Invalid deserialization result: " + userEx);

                  faultEx.initCause((Exception)userEx);
               }
               catch (RuntimeException rte)
               {
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.