SOAPUI searchRequest list of appointment

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
Post Reply
G71
Posts: 23
Joined: Fri Aug 19, 2016 10:01 am

SOAPUI searchRequest list of appointment

Post by G71 »

Dear,

I'm newbie of Zimbra and I searched inside the forum but with no lucky.
I'm sure to have appointment on the calendar of my user but asking by SOAPUI interface, I didn't get.

This is my code

Code: Select all

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:zimbra" xmlns:urn1="urn:zimbraMail">
   <soapenv:Header>
      <urn:context hops="0">
               <urn:authToken>0_ff90a3938851f22c62ede1e7f5f5ae36163acbb0_69643d33363a30623330383161382d303731392d343337632d613162362d3066363565623063613836623b6578703d31333a313437323839333438393830393b747970653d363a7a696d6272613b7469643d383a33353536323736343b76657273696f6e3d31333a382e362e305f47415f313135333b</urn:authToken>
      </urn:context>
   </soapenv:Header>
   <soapenv:Body>
      <urn1:SearchRequest types="appointment" calExpandInstStart="1473073201000" calExpandInstEnd="1473094801000" limit="10000"  sortBy="dateDesc" >
      </urn1:SearchRequest>
   </soapenv:Body>
</soapenv:Envelope>
and this is the response but without appointments:

Code: Select all

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Header>
      <context xmlns="urn:zimbra"/>
   </soap:Header>
   <soap:Body>
      <SearchResponse offset="0" more="0" sortBy="dateDesc" xmlns="urn:zimbraMail"/>
   </soap:Body>
</soap:Envelope>
Where is mistake?

Thanks a lot

G71
G71
Posts: 23
Joined: Fri Aug 19, 2016 10:01 am

Re: SOAPUI searchRequest list of appointment

Post by G71 »

SOLVED: missing query tag

Code: Select all

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:zimbra" xmlns:urn1="urn:zimbraMail">
   <soapenv:Header>
      <urn:context hops="0">
         <!--You may enter the following 16 items in any order-->
         <!--Optional:-->
         <urn:authToken>myNewToken</urn:authToken>
      </urn:context>
   </soapenv:Header>
   <soapenv:Body>
      <urn1:SearchRequest types="appointment" calExpandInstStart="1473073201000" calExpandInstEnd="1473094801000" limit="10000"  sortBy="dateDesc" >
      <query>inid:10</query>
      </urn1:SearchRequest>
   </soapenv:Body>
</soapenv:Envelope>
Rafael
Posts: 11
Joined: Tue Sep 06, 2016 2:49 pm

Re: SOAPUI searchRequest list of appointment

Post by Rafael »

Hi G71,

Do you get it?

I new too with zimbra, and I don't undestand well the document, so if you can help me please, I'm totally lost about zimbra soap.

Best Regards
Rafael
G71
Posts: 23
Joined: Fri Aug 19, 2016 10:01 am

Re: SOAPUI searchRequest list of appointment

Post by G71 »

Rafael wrote:Hi G71,

Do you get it?

I new too with zimbra, and I don't undestand well the document, so if you can help me please, I'm totally lost about zimbra soap.

Best Regards
Rafael
Hi Rafael

What is your dubt, exactly?
Rafael
Posts: 11
Joined: Tue Sep 06, 2016 2:49 pm

Re: SOAPUI searchRequest list of appointment

Post by Rafael »

Hi G71,

I see you used soap ui to test zimbra webservice.
How you do that? I mean, What I have to do exactly?

Example:
Method = GetAppointmentRequest

There is a part that you have to authenticate the user (I don't now how).
There is a part that you have to especific the attibute that you wanna(I see the doc of the ZImbra webservice and I don't understant nothing).
I see there is a param to use, but again I don't understand how to use.

If you used before and work, can you show to me a example how you did?

If I see how to use, I think I can understand how to proceed by my own.

I create a post too named "How to use Zimbra Soap? ", the I put the schema of the soap UI, and I ask there how each part works.

Can you help me?

Best Regards
Rafael
G71
Posts: 23
Joined: Fri Aug 19, 2016 10:01 am

Re: SOAPUI searchRequest list of appointment

Post by G71 »

Rafael wrote:Hi G71,

I see you used soap ui to test zimbra webservice.
How you do that? I mean, What I have to do exactly?

Example:
Method = GetAppointmentRequest

There is a part that you have to authenticate the user (I don't now how).
There is a part that you have to especific the attibute that you wanna(I see the doc of the ZImbra webservice and I don't understant nothing).
I see there is a param to use, but again I don't understand how to use.

If you used before and work, can you show to me a example how you did?

If I see how to use, I think I can understand how to proceed by my own.

I create a post too named "How to use Zimbra Soap? ", the I put the schema of the soap UI, and I ask there how each part works.

Can you help me?

Best Regards
Rafael
Dear, first of all, you have to point your soapUi project to
http://yourServerZimbra/service/wsdl/ZimbraService.wsdl or
http://yourServerZimbra/service/wsdl/Zi ... rvice.wsdl or
http://yourServerZimbra/service/wsdl/Zi ... rvice.wsdl
Depends what you need. This is explained in the documentation.

Then, you have to do the autRequest request in order to have an authorization token:

Request

Code: Select all

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
   <soapenv:Header>
      <urn:context xmlns:urn="urn:zimbra"/>
   </soapenv:Header>
   <soapenv:Body>
      <urn1:AuthRequest  xmlns:urn1="urn:zimbraAccount">
         <!--You may enter the following 8 items in any order-->
         <!--Optional:-->
         <urn1:account by="name">yourEmail@blabla.com</urn1:account>
         <!--Optional:-->
         <urn1:password>12345678</urn1:password>
      </urn1:AuthRequest>
   </soapenv:Body>
</soapenv:Envelope>
Response:

Code: Select all

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Header>
      <context xmlns="urn:zimbra"/>
   </soap:Header>
   <soap:Body>
      <AuthResponse xmlns="urn:zimbraAccount">
         <authToken>0_4eb47f4cd945454bd58c10001d9227eeaad3b12c_69643d33363a30623330383161382d303731392d343337632d613162362d3066363565623063613836623b6578703d31333a313437333538323639313537353b747970653d363a7a696d6272613b7469643d393a3636303230313034353b76657273696f6e3d31333a382e362e305f47415f313135333b</authToken>
         <lifetime>172800000</lifetime>
         <skin>harmony</skin>
      </AuthResponse>
   </soap:Body>
</soap:Envelope>
The token get inside authToken TAG into the response is that you have to use for your next request. Put it in the your new request. In your case for GetAppointmentRequest, you can use the request write above. you can note that inside the header there is tag context\authToken valorized with a token obtained before in separate authRequest.

For the other TAGs, they are very understable. Otherwise you can read the documentation: https://wiki.zimbra.com/wiki/SOAP_API_R ... with_ZCS_8

Regards!

G71
Rafael
Posts: 11
Joined: Tue Sep 06, 2016 2:49 pm

Re: SOAPUI searchRequest list of appointment

Post by Rafael »

Hi G71,

thanks,

this help me a lot.
Now I'm Trying do the same with java, do you know use java?

If you have some example of how create an authentication with java let me know please.

Thank you for all again.

Best regards
Rafael
G71
Posts: 23
Joined: Fri Aug 19, 2016 10:01 am

Re: SOAPUI searchRequest list of appointment

Post by G71 »

Rafael wrote:Hi G71,

thanks,

this help me a lot.
Now I'm Trying do the same with java, do you know use java?

If you have some example of how create an authentication with java let me know please.

Thank you for all again.

Best regards
Rafael
viewtopic.php?f=17&t=60393&p=270906#p270906
Post Reply