Results 1 to 4 of 4

Thread: Sending SOAP message and receiving JSON

  1. #1
    Join Date
    Aug 2010
    Posts
    17
    Rep Power
    5

    Default Sending SOAP message and receiving JSON

    I can successfully send a SOAP message over a java client and get the response. Now let's say I need to receive a JSON response, what would be the approach?

    My client looks like this:
    Code:
    SOAPConnection soapConnection = SOAPConnectionFactory.newInstance().createConnection();
            MessageFactory messageFactory = MessageFactory.newInstance();
    
            // Create a message from the message factory.
            SOAPMessage soapMessage = messageFactory.createMessage();
    
           //build soap message and add format attribute and set it to JS in the message
            soapMessage.saveChanges();
            URLEndpoint endpoint = new URLEndpoint("https://zimbra-box:7071/service/admin/soap");
             
            SOAPMessage reply = soapConnection.call(soapMessage, endpoint);
    
            //Modify this part to return a JSON string
    Any hints or suggestions?

  2. #2
    Join Date
    Sep 2010
    Posts
    6
    Rep Power
    5

    Default

    Quote Originally Posted by fmatar View Post
    I can successfully send a SOAP message over a java client and get the response. Now let's say I need to receive a JSON response, what would be the approach?
    ...
    Any hints or suggestions?
    you have to put a 'format' element in the SOAP header part, such as the XML results in:

    <soap:Envelope ...>
    <soap:Header>
    ...
    <format type='js' />
    </soap:Header>
    ...
    </soap:Envelope>

  3. #3
    Join Date
    Aug 2010
    Posts
    17
    Rep Power
    5

    Default

    No that doesn't work, you can't receive a JSON string as SOAP message

  4. #4
    Join Date
    Sep 2010
    Posts
    6
    Rep Power
    5

    Default

    Quote Originally Posted by fmatar View Post
    No that doesn't work, you can't receive a JSON string as SOAP message
    Uh... maybe i do not use the same zimbra version, but mine has JSON replies (when i ask for it)

Similar Threads

  1. Sending and Receiving Mails HELP!!!!
    By betchok in forum Administrators
    Replies: 2
    Last Post: 07-15-2010, 03:21 AM
  2. Maill sending and receiving problem
    By sureshbdu in forum Administrators
    Replies: 16
    Last Post: 05-08-2010, 04:47 AM
  3. Replies: 2
    Last Post: 11-29-2009, 09:16 PM
  4. Error when sending, receiving messages
    By Kaloz in forum Installation
    Replies: 2
    Last Post: 02-12-2008, 11:24 PM
  5. Sending but not receiving
    By pbwebguy in forum Administrators
    Replies: 11
    Last Post: 06-22-2006, 01:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •