Package org.xmlsoap.schemas.soap.envelope

Examples of org.xmlsoap.schemas.soap.envelope.EnvelopeDocument


    @Test
    public void testEmptyRequest()
    {
        ExchangeService service = new ExchangeService(URL);

        EnvelopeDocument request = service.createEmptyRequest("bkerr@INT.TARTARUS.COM");
        assertTrue(request.getEnvelope().isSetHeader());
        assertTrue(request.getEnvelope().getHeader().isSetExchangeImpersonation());
        ExchangeImpersonationType impersonation = request.getEnvelope().getHeader().getExchangeImpersonation();
        assertTrue(impersonation.getConnectingSID().isSetPrincipalName());
        assertEquals("bkerr@INT.TARTARUS.COM", impersonation.getConnectingSID().getPrincipalName());

        request = service.createEmptyRequest("korganizer@INT.TARTARUS.COM");
        assertEquals("korganizer@INT.TARTARUS.COM", request.getEnvelope().getHeader().getExchangeImpersonation()
                                                           .getConnectingSID().getPrincipalName());
    }
View Full Code Here


        if (code == HttpURLConnection.HTTP_OK)
        {
            checkNonEmptyResponse(request, amtAvailable);

            EnvelopeDocument response = parseResponse(responseData, charset);
            LOG.trace("SOAP response received from {}.  SOAP envelope:", endpoint);
            LOG.trace(response.toString());
            return getSoapBody(response);
        }
        else
        {
            return logAndThrowHttpErrorCode(request, code, responseData, amtAvailable, charset);
View Full Code Here

    }

    private EnvelopeDocument parseResponse(final InputStream responseData, final String charset)
            throws ServiceCallException
    {
        EnvelopeDocument response;
        try
        {
            response = EnvelopeDocument.Factory.parse(responseData);
        }
        catch (IOException e)
View Full Code Here

        return conn;
    }

    EnvelopeDocument createEmptyRequest(final String targetUser)
    {
        EnvelopeDocument request = EnvelopeDocument.Factory.newInstance();
        EnvelopeType envelope = request.addNewEnvelope();
        envelope.addNewHeader().addNewExchangeImpersonation().addNewConnectingSID().setPrincipalName(targetUser);
        return request;
    }
View Full Code Here

     */
    public SyncFolderItemsResponseType syncFolderItems(final SyncFolderItemsType syncFolderItems,
                                                       final String targetUser)
            throws ServiceCallException, HttpErrorException
    {
        EnvelopeDocument request = createEmptyRequest(targetUser);
        EnvelopeType envelope = request.getEnvelope();
        envelope.addNewBody().setSyncFolderItems(syncFolderItems);

        return sendRequest(request).getSyncFolderItemsResponse();
    }
View Full Code Here

     *                              such as an improper encoding or IO error.
     */
    public GetItemResponseType getItem(final GetItemType getItem, final String targetUser)
        throws ServiceCallException, HttpErrorException
    {
        EnvelopeDocument request = createEmptyRequest(targetUser);
        EnvelopeType envelope = request.getEnvelope();
        envelope.addNewBody().setGetItem(getItem);

        return sendRequest(request).getGetItemResponse();
    }
View Full Code Here

     * @throws HttpErrorException A HTTP error has occurred during the request.
     */
    public FindFolderResponseType findFolder(final FindFolderType findFolder, final String targetUser)
        throws ServiceCallException, HttpErrorException
    {
        EnvelopeDocument request = createEmptyRequest(targetUser);
        EnvelopeType envelope = request.getEnvelope();
        envelope.addNewBody().setFindFolder(findFolder);

        return sendRequest(request).getFindFolderResponse();
    }
View Full Code Here

TOP

Related Classes of org.xmlsoap.schemas.soap.envelope.EnvelopeDocument

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.