Examples of Detail


Examples of javax.xml.soap.Detail

      if (soapFault == null)
         throw new IllegalArgumentException("SOAPFault cannot be null");

      SOAPFaultException faultEx = new SOAPFaultException(soapFault);

      Detail detail = soapFault.getDetail();
      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      if (detail != null && msgContext != null)
      {
         log.debug("Processing detail");
         SerializationContext serContext = msgContext.getSerializationContext();
         TypeMapping typeMapping = serContext.getTypeMapping();

         Iterator it = detail.getDetailEntries();
         while (it.hasNext())
         {
            DetailEntry deElement = (DetailEntry)it.next();
            QName xmlName = deElement.getElementQName();
            log.debug("Processing detail entry: " + xmlName);
View Full Code Here

Examples of javax.xml.soap.Detail

      populateSOAPFault(soapBody, faultEx);

      /* detail
       * X. Serialized service specific exception
       * 2. SOAPFaultException.getFault().getDetail() */
      Detail detail = faultEx.getFault().getDetail();
      if (detail != null)
         soapBody.getFault().addChildElement(detail);

      return soapMessage;
   }
View Full Code Here

Examples of javax.xml.soap.Detail

      if (opMetaData != null && opMetaData.getFaultMetaData(exClass) != null)
      {
         FaultMetaData faultMetaData = opMetaData.getFaultMetaData(exClass);
         Object faultBean = faultMetaData.toFaultBean(ex);

         Detail detail = soapFault.addDetail();
         SOAPElement detailEntry = toDetailEntry(faultBean, serContext, faultMetaData);
         detail.addChildElement(detailEntry);
      }
      else
         log.debug("Cannot obtain fault meta data for: " + exClass);

      return soapMessage;
View Full Code Here

Examples of javax.xml.soap.Detail

   public static SOAPFaultException getSOAPFaultException(SOAPFault soapFault)
   {
      QName faultCode = ((NameImpl)soapFault.getFaultCodeAsName()).toQName();
      String faultString = soapFault.getFaultString();
      String faultActor = soapFault.getFaultActor();
      Detail detail = soapFault.getDetail();

      SOAPFaultException faultEx = new SOAPFaultException(faultCode, faultString, faultActor, detail);

      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
      if (detail != null && msgContext != null)
      {
         SerializationContext serContext = msgContext.getSerializationContext();
         TypeMapping typeMapping = serContext.getTypeMapping();

         Iterator it = detail.getDetailEntries();
         while (it.hasNext())
         {
            DetailEntry deElement = (DetailEntry)it.next();
            Name deName = deElement.getElementName();
            QName xmlName = new QName(deName.getURI(), deName.getLocalName());
View Full Code Here

Examples of javax.xml.soap.Detail

         SOAPElement soapElement = soapFault.addChildElement("faultactor");
         soapElement.addTextNode(faultActor);
      }

      Exception faultCause = (Exception)faultEx.getCause();
      Detail detail = faultEx.getDetail();
      if (detail != null)
      {
         soapFault.addChildElement(detail);
      }
      else if (faultCause != null && (faultCause instanceof RuntimeException) == false)
      {
         Class javaType = faultCause.getClass();

         TypeMapping typeMapping = serContext.getTypeMapping();

         OperationMetaData opMetaData = msgContext.getOperationMetaData();
         if (opMetaData != null && opMetaData.getFaultMetaData(javaType) != null)
         {
            FaultMetaData faultMetaData = opMetaData.getFaultMetaData(javaType);
            QName xmlName = faultMetaData.getXmlName();
            QName xmlType = faultMetaData.getXmlType();

            xmlName = nsRegistry.registerQName(xmlName);

            // Get the serializer from the type mapping
            AbstractSerializerFactory serFactory = (AbstractSerializerFactory)typeMapping.getSerializer(javaType, xmlType);
            if (serFactory == null)
               throw new JAXRPCException("Cannot obtain serializer factory for: " + xmlType);

            try
            {
               SerializerSupport ser = (SerializerSupport)serFactory.getSerializer();
               Result result = ser.serialize(xmlName, xmlType, faultCause, serContext, null);
               XMLFragment xmlFragment = new XMLFragment(result);

               Element domElement = xmlFragment.toElement();
               SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
               SOAPElement soapElement = soapFactory.createElement(domElement);

               detail = soapFault.addDetail();
               detail.addChildElement(soapElement);
            }
            catch (BindingException e)
            {
               throw new JAXRPCException(e);
            }
View Full Code Here

Examples of javax.xml.soap.Detail

      SOAPMessage reqMsg = getRequestMessage();
      URL epURL = new URL(TARGET_ENDPOINT_ADDRESS);
      SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
      SOAPMessage resMsg = con.call(reqMsg, epURL);
      SOAPEnvelope resEnv = resMsg.getSOAPPart().getEnvelope();
      Detail detail = resEnv.getBody().getFault().getDetail();
      assertNotNull(detail);
      SOAPElement exception = (SOAPElement)detail.getDetailEntries().next();
      assertNotNull(exception);
      assertEquals(exception.getNodeName(), "MyWSException");
      SOAPElement message = (SOAPElement)exception.getChildElements().next();
      assertNotNull(message);
      assertEquals(message.getNodeName(), "message");
View Full Code Here

Examples of javax.xml.soap.Detail

   public SOAPMessage invoke(SOAPMessage requestSoapMessage)
   {
      SOAPFault theSOAPFault;
      try {
         theSOAPFault = SOAPFactory.newInstance().createFault();
         Detail soapFaultDetail = theSOAPFault.addDetail();
         SOAPElement myFaultElement = soapFaultDetail.addChildElement(new QName("http://www.my-company.it/ws/my-test", "MyWSException"));
         SOAPElement myMessageElement = myFaultElement.addChildElement(new QName("http://www.my-company.it/ws/my-test", "message"));
//         myMessageElement.setNodeValue("This is a faked error"); //wrong: myMessageElement is not a text node
         myMessageElement.setValue("This is a faked error"); //right: this creates a text node and gives it a text value
      } catch (SOAPException se) {
         se.printStackTrace();
View Full Code Here

Examples of javax.xml.soap.Detail

                    soapFault.setFaultActor(fault.getRole());
                }
                if (fault.getDetail() != null
                    && fault.getDetail().getFirstChild() != null) {
                   
                    Detail detail = null;
                    Node child = fault.getDetail().getFirstChild();
                    while (child != null) {
                        if (Node.ELEMENT_NODE == child.getNodeType()) {
                            if (detail == null) {
                                detail = soapFault.addDetail();
                            }
                            Node importedChild = soapMessage.getSOAPPart().importNode(child, true);
                            detail.appendChild(importedChild);
                        }
                        child = child.getNextSibling();
                    }
                }
View Full Code Here

Examples of org.apache.axis.message.Detail

    * @param rufe The ResourceUnknownFaultException to convert to a SOAPFaultException
    */
   private void throwSOAPFaultExceptionWithDetails( ResourceUnknownFaultException rufe )
   {
      BaseFaultType bft     = AxisGenTypesUtils.toAxisBaseFault( rufe );
      Detail        detail  = new Detail(  );
      Element[]     details = bft.getFaultDetails(  );

      for ( int i = 0; i < details.length; i++ )
      {
         try
         {
            detail.addChildElement( SaajUtils.toSOAPElement( details[i] ) );
         }
         catch ( SOAPException e1 )
         {
            throw new JAXRPCException( e1.getLocalizedMessage(  ) );
         }
View Full Code Here

Examples of org.apache.jackrabbit.ocm.testmodel.proxy.Detail

  public void testBeanProxy() {

    try {
      ObjectContentManager ocm = this.getObjectContentManager();

      Detail detail = new Detail();
      detail.setField("FieldValue");     
     
      Detail proxyDetail = new Detail();
      proxyDetail.setField("ProxyFieldValue");
     
      Main main = new Main();
      main.setPath("/test");
      main.setDetail(detail);
      main.setProxyDetail(proxyDetail);
             
            ocm.insert(main);
      ocm.save();
     
     
      //---------------------------------------------------------------------------------------------------------
      // Retrieve the main object
      //---------------------------------------------------------------------------------------------------------           
      main = (Main) ocm.getObject( "/test");
      assertNotNull("detail is null", main.getDetail());
      assertTrue("Invalid detail bean", main.getDetail().getField().equals("FieldValue"));

      assertNotNull("proxydetail is null", main.getProxyDetail());
      Object proxyObject = main.getProxyDetail();
      assertTrue("Invalid class specify for the proxy bean", proxyObject  instanceof Detail);
      assertTrue("Invalid proxy detail bean",proxyDetail .getField().equals("ProxyFieldValue"));
     
      Detail nullDetail = main.getNullDetail();
      assertNull("nulldetail is not  null",nullDetail );

     
      //---------------------------------------------------------------------------------------------------------
      // Update 
      //---------------------------------------------------------------------------------------------------------           
       detail = new Detail();
      detail.setField("AnotherFieldValue");     
     
      proxyDetail = new Detail();
      proxyDetail.setField("AnotherProxyFieldValue");
     
      main.setDetail(detail);
      main.setProxyDetail(proxyDetail);
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.