Examples of EnvelopeImpl


Examples of com.sun.xml.messaging.saaj.soap.impl.EnvelopeImpl

        // Record the presence of xml declaration before the envelope gets
        // created.
        XMLDeclarationParser parser = lookForXmlDecl();
        Source tmp = source;
        source = null;
        EnvelopeImpl envelope =
            (EnvelopeImpl) EnvelopeFactory.createEnvelope(tmp, this);

        if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE)) {
            log.severe("SAAJ0304.ver1_1.msg.invalid.SOAP1.1");
            throw new SOAPException("InputStream does not represent a valid SOAP 1.1 Message");
        }

        if (parser != null && !omitXmlDecl) {
            envelope.setOmitXmlDecl("no");
            envelope.setXmlDecl(parser.getXmlDeclaration());
            envelope.setCharsetEncoding(parser.getEncoding());
        }
        return envelope;
    }
View Full Code Here

Examples of com.sun.xml.messaging.saaj.soap.impl.EnvelopeImpl

    protected Envelope createEnvelopeFromSource() throws SOAPException {
        XMLDeclarationParser parser = lookForXmlDecl();
        Source tmp = source;
        source = null;
        EnvelopeImpl envelope = (EnvelopeImpl)EnvelopeFactory.createEnvelope(tmp, this);
        if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE)) {
            log.severe("SAAJ0415.ver1_2.msg.invalid.soap1.2");
            throw new SOAPException("InputStream does not represent a valid SOAP 1.2 Message");
        }

        if (parser != null) { //can be null if source was a DomSource and not StreamSource
            if (!omitXmlDecl) {
                envelope.setOmitXmlDecl("no");
                envelope.setXmlDecl(parser.getXmlDeclaration());
                envelope.setCharsetEncoding(parser.getEncoding());
            }
        }
        return envelope;

    }
View Full Code Here

Examples of com.sun.xml.messaging.saaj.soap.impl.EnvelopeImpl

            if (!("true".equals(value) || "false".equals(value)))
                throw new RuntimeException(
                    property + " must have value false or true");

            try {
                EnvelopeImpl env = (EnvelopeImpl) getSOAPPart().getEnvelope();
                if ("true".equalsIgnoreCase((String)value)) {
                    env.setOmitXmlDecl("no");
                } else if ("false".equalsIgnoreCase((String)value)) {
                    env.setOmitXmlDecl("yes");
                }
            } catch (Exception e) {
                log.log(Level.SEVERE, "SAAJ0591.soap.exception.in.set.property",
                    new Object[] {e.getMessage(), "javax.xml.soap.write-xml-declaration"});
                throw new RuntimeException(e);
View Full Code Here

Examples of com.sun.xml.messaging.saaj.soap.impl.EnvelopeImpl

    protected Envelope createEnvelopeFromSource() throws SOAPException {
        XMLDeclarationParser parser = lookForXmlDecl();
        Source tmp = source;
        source = null;
        EnvelopeImpl envelope = (EnvelopeImpl)EnvelopeFactory.createEnvelope(tmp, this);
        if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE)) {
            log.severe("SAAJ0415.ver1_2.msg.invalid.soap1.2");
            throw new SOAPException("InputStream does not represent a valid SOAP 1.2 Message");
        }

        if (!omitXmlDecl) {
            envelope.setOmitXmlDecl("no");
            envelope.setXmlDecl(parser.getXmlDeclaration());
            envelope.setCharsetEncoding(parser.getEncoding());
        }
        return envelope;

    }
View Full Code Here

Examples of com.sun.xml.messaging.saaj.soap.impl.EnvelopeImpl

        // Record the presence of xml declaration before the envelope gets
        // created.
        XMLDeclarationParser parser = lookForXmlDecl();
        Source tmp = source;
        source = null;
        EnvelopeImpl envelope =
            (EnvelopeImpl) EnvelopeFactory.createEnvelope(tmp, this);

        if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE)) {
            log.severe("SAAJ0304.ver1_1.msg.invalid.SOAP1.1");
            throw new SOAPException("InputStream does not represent a valid SOAP 1.1 Message");
        }

        if (!omitXmlDecl) {
            envelope.setOmitXmlDecl("no");
            envelope.setXmlDecl(parser.getXmlDeclaration());
            envelope.setCharsetEncoding(parser.getEncoding());
        }
        return envelope;
    }
View Full Code Here

Examples of com.sun.xml.messaging.saaj.soap.impl.EnvelopeImpl

    protected Envelope createEnvelopeFromSource() throws SOAPException {
        XMLDeclarationParser parser = lookForXmlDecl();
        Source tmp = source;
        source = null;
        EnvelopeImpl envelope = (EnvelopeImpl)EnvelopeFactory.createEnvelope(tmp, this);
        if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE)) {
            log.severe("SAAJ0415.ver1_2.msg.invalid.soap1.2");
            throw new SOAPException("InputStream does not represent a valid SOAP 1.2 Message");
        }

        if (parser != null) { //can be null if source was a DomSource and not StreamSource
            if (!omitXmlDecl) {
                envelope.setOmitXmlDecl("no");
                envelope.setXmlDecl(parser.getXmlDeclaration());
                envelope.setCharsetEncoding(parser.getEncoding());
            }
        }
        return envelope;

    }
View Full Code Here

Examples of com.sun.xml.messaging.saaj.soap.impl.EnvelopeImpl

            if (!("true".equals(value) || "false".equals(value)))
                throw new RuntimeException(
                    property + " must have value false or true");

            try {
                EnvelopeImpl env = (EnvelopeImpl) getSOAPPart().getEnvelope();
                if ("true".equalsIgnoreCase((String)value)) {
                    env.setOmitXmlDecl("no");
                } else if ("false".equalsIgnoreCase((String)value)) {
                    env.setOmitXmlDecl("yes");
                }
            } catch (Exception e) {
                log.log(Level.SEVERE, "SAAJ0591.soap.exception.in.set.property",
                    new Object[] {e.getMessage(), "javax.xml.soap.write-xml-declaration"});
                throw new RuntimeException(e);
View Full Code Here

Examples of com.sun.xml.messaging.saaj.soap.impl.EnvelopeImpl

        // Record the presence of xml declaration before the envelope gets
        // created.
        XMLDeclarationParser parser = lookForXmlDecl();
        Source tmp = source;
        source = null;
        EnvelopeImpl envelope =
            (EnvelopeImpl) EnvelopeFactory.createEnvelope(tmp, this);

        if (!envelope.getNamespaceURI().equals(SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE)) {
            log.severe("SAAJ0304.ver1_1.msg.invalid.SOAP1.1");
            throw new SOAPException("InputStream does not represent a valid SOAP 1.1 Message");
        }

        if (parser != null && !omitXmlDecl) {
            envelope.setOmitXmlDecl("no");
            envelope.setXmlDecl(parser.getXmlDeclaration());
            envelope.setCharsetEncoding(parser.getEncoding());
        }
        return envelope;
    }
View Full Code Here

Examples of org.geotools.geometry.iso.coordinate.EnvelopeImpl

    // Envelope.getDimension()
    assertTrue(dp2.getDimension() == 2);
    //System.outprintln("Dimension of dp1: " + dp2.getDimension());
   
    EnvelopeImpl env1 = new EnvelopeImpl(dp1, dp2);
   
    // Envelope.getLowerCorner() + Envelope.equals(DP, tol)
    assertTrue(env1.getLowerCorner().equals(dp1));
    //System.outprintln(env1.getLowerCorner());
   
    // Envelope.getUpperCorner() + Envelope.equals(DP, tol)
    assertTrue(env1.getUpperCorner().equals(dp2));
    //System.outprintln(env1.getUpperCorner());
    //System.outprintln(env1);
   
    EnvelopeImpl env2 = new EnvelopeImpl(env1);
    //System.outprintln(env2);
   
    // Envelope.equals(Envelope)
    assertTrue(env1.equals(env2));
   
   
    DirectPosition dp3 = tCoordFactory.createDirectPosition(new double[] {0,0});
    DirectPosition dp4 = tCoordFactory.createDirectPosition(new double[] {100,50});
    DirectPosition dp5 = tCoordFactory.createDirectPosition(new double[] {100.01,50});
    DirectPosition dp6 = tCoordFactory.createDirectPosition(new double[] {50,100});
    DirectPosition dp7 = tCoordFactory.createDirectPosition(new double[] {50,100.01});
   
    // Envelope.contains(DirectPosition)
    //System.outprintln("Contains Method for " + env1);
    assertTrue(env1.contains(dp3) == true);
    //System.outprintln(dp3 + " liegt im Envelope: " + env1.contains(dp3));
    assertTrue(env1.contains(dp4) == true);
    //System.outprintln(dp4 + " liegt im Envelope: " + env1.contains(dp4));
    assertTrue(env1.contains(dp5) == false);
    //System.outprintln(dp5 + " liegt im Envelope: " + env1.contains(dp5));
    assertTrue(env1.contains(dp6) == true);
    //System.outprintln(dp6 + " liegt im Envelope: " + env1.contains(dp6));
    assertTrue(env1.contains(dp7) == false);
    //System.outprintln(dp7 + " liegt im Envelope: " + env1.contains(dp7));

//    DirectPositionImpl dp8 = tCoordFactory.createDirectPosition(new double[] {200,200});
//   
//    EnvelopeImpl env2 = new EnvelopeImpl(dp6, dp8);
//    EnvelopeImpl env3 = new EnvelopeImpl(dp7, dp8);
//   
//    //System.outprintln(env1 + " intersects with " + env2 + " : " + env1.intersects(env2));
//    //System.outprintln(env1 + " intersects with " + env3 + " : " + env1.intersects(env3));
   
    //System.outprintln("TEST EXPAND");
    env1 = tCoordFactory.createEnvelope(dp1.getCoordinate());
    //System.outprintln(env1);
    env1.expand(dp2.getCoordinate());
    //System.outprintln(env1);
    env1.expand(dp5.getCoordinate());
    //System.outprintln(env1);
   
    // Test other envelope methods
    env1.setValues(env2);
    DirectPosition[] dpArray = new DirectPositionImpl[2];
    dpArray[0] = dp0;
    dpArray[1] = dp4;
    EnvelopeImpl impl = env1.createEnvelope(dpArray);
   
    // test toString
    String toS = impl.toString();
    assertTrue(toS != null);
    assertTrue(toS.length() > 0);
   
    // test intersects
    assertTrue(impl.intersects(dp0));
    assertFalse(impl.intersects(dp1));
   
    // test get corners
    assertTrue(impl.getNECorner().equals(dp0));
    assertTrue(impl.getSWCorner().equals(dp4));
    try {
      assertTrue(impl.getSECorner().equals(dp4));
    } catch (UnsupportedDimensionException e) {
      e.printStackTrace();
      fail();
    }
    try {
      assertTrue(impl.getNWCornerOld().equals(dp0));
    } catch (UnsupportedDimensionException e) {
      e.printStackTrace();
      fail();
    }
  }
View Full Code Here

Examples of org.geotools.geometry.iso.coordinate.EnvelopeImpl

    PrimitiveFactoryImpl factory = (PrimitiveFactoryImpl) container.getComponentInstanceOfType( PrimitiveFactoryImpl.class );
    PositionFactory positionFactory = (PositionFactory ) container.getComponentInstanceOfType( PositionFactory.class );
   
    DirectPosition positionA = positionFactory.createDirectPosition(new double[]{10, 10});
    DirectPosition positionB = positionFactory.createDirectPosition(new double[]{70, 30});
    Envelope bounds = new EnvelopeImpl( positionA, positionB );
   
    LineSegmentImpl expected = new LineSegmentImpl( crs, new double[]{10,Double.NaN}, new double[]{70,Double.NaN}, 0.0 );   
   
    LineSegment actual =  factory.processBoundsToSegment( bounds );
    assertNotNull( actual );
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.