Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: soap CreateAccountRequest code

  1. #1
    crossany is offline Senior Member
    Join Date
    Mar 2006
    Posts
    59
    Rep Power
    9

    Default soap CreateAccountRequest code

    I just try to send a soap request like this:
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
    <context xmlns="urn:zimbra">
    <authToken>admin@cross.com</authToken>
    </context>
    </soap:Header>
    <soap:Body>
    <CreateAccountRequest xmlns="urn:zimbraAdmin">
    <name>rush@cross.com</name>
    <password>zimbra</password>
    </CreateAccountRequest>
    </soap:Body>
    </soap:Envelope>
    but I failure who can tell me the right code thank you !

  2. #2
    sam
    sam is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    821
    Rep Power
    11

    Default

    The auth token is incorrect. It needs to be what was returned by the server in a previous AuthRequest.
    Sam Khavari

    :: :: [ Zimbra ] :: :: [ Bugzilla ] :: :: [ Product Portal ] :: :: [ Wiki ] :: :: [ Downloads ] :: :: [ . ] ::

  3. #3
    crossany is offline Senior Member
    Join Date
    Mar 2006
    Posts
    59
    Rep Power
    9

    Default could you give me a example

    I don't konw what your mean
    could you give me a example thank you

  4. #4
    sam
    sam is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    821
    Rep Power
    11

    Default

    yeah, first send

    <Envelope xmlns="http://www.w3.org/2003/05/soap-envelope">
    <Body>
    <AuthRequest xmlns="urn:zimbraAccount">
    <account by="name">user1</account>
    <password>****</password>
    </AuthRequest>
    </Body>
    </Envelope>

    you'll get back

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>...stuff...
    </soap:Header>
    <soap:Body>
    <AuthResponse xmlns="urn:zimbraAccount">
    <authToken>...auth_token...</authToken>
    <lifetime>172800000</lifetime>
    <sessionId id="55">55</sessionId>
    </AuthResponse>
    </soap:Body>
    </soap:Envelope>


    You must save the auth_token and sessionId and pass it back to the server in subsequent requests.
    Sam Khavari

    :: :: [ Zimbra ] :: :: [ Bugzilla ] :: :: [ Product Portal ] :: :: [ Wiki ] :: :: [ Downloads ] :: :: [ . ] ::

  5. #5
    crossany is offline Senior Member
    Join Date
    Mar 2006
    Posts
    59
    Rep Power
    9

    Default it's doesn't reply soap Response

    I write a Java code like this :
    public class NoCertificationHttpsGetSample {
    public static void main(String[] args) {
    Protocol myhttps = new Protocol("https",
    new MySecureProtocolSocketFactory(),7071);
    Protocol.registerProtocol("https", myhttps);
    HttpClient httpClient = new HttpClient();
    httpClient.getHostConfiguration().setHost("192.168 .1.127",7071,myhttps);
    String url="https://192.168.1.127:7071/service/admin/soap";
    PostMethod postMethod = new PostMethod(url);
    postMethod.getParams().setParameter(HttpMethodPara ms.RETRY_HANDLER,
    new DefaultHttpMethodRetryHandler());
    try{
    InputStream soap= new FileInputStream("soap.xml");
    postMethod.setRequestBody(soap);
    }catch(Exception err){};
    try{
    int statusCode = httpClient.executeMethod(postMethod);
    if (statusCode != HttpStatus.SC_OK) {
    System.err.println("Method failed: "+ postMethod.getStatusLine());
    }
    byte[] responseBody = postMethod.getResponseBody();
    System.out.println(new String(responseBody));
    } catch (HttpException e) {
    System.out.println("Please check your provided https address!");
    e.printStackTrace();
    } catch (IOException e) {
    e.printStackTrace();
    } finally{
    postMethod.releaseConnection();
    }

    }
    }
    soap.xml like this :
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Body>
    <AuthRequest xmlns="urn:zimbraAdmin">
    <name>admin@sina.com</name>
    <password>zimbra</password>
    </AuthRequest>
    </soap:Body>
    </soap:Envelope>

    this Error like this :

    Method failed: HTTP/1.1 500 Internal Server Error
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Body><soap:Fault><soap:Code><soap: Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text>system failure: Request not allowed on port 443</soap:Text></soap:Reason><soapetail><Error xmlns="urn:zimbra"><Code>service.FAILURE</Code><Trace>com.zimbra.cs.service.ServiceException : system failure: Request not allowed on port 443
    at com.zimbra.cs.service.ServiceException.FAILURE(Ser viceException.java:99)
    at com.zimbra.cs.servlet.ZimbraServlet.service(Zimbra Servlet.java:136)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:214)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:107)
    at org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:526)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:825)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:738)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:526)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)
    </Trace></Error></soapetail></soap:Fault></soap:Body></soap:Envelope>

    anybody can tell me why
    I crazy !
    Last edited by crossany; 07-05-2010 at 12:39 AM.

  6. #6
    KevinH's Avatar
    KevinH is offline Expert Member
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    Are you sure your using the API correctly? Seems the request is going to 443 and not 7071.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  7. #7
    crossany is offline Senior Member
    Join Date
    Mar 2006
    Posts
    59
    Rep Power
    9

    Default I know the port error

    I know the port error but if I getMethod from "https://192.168.1.127:7071"
    the will response the HTML code so I think it's will be the soap was wrong

  8. #8
    KevinH's Avatar
    KevinH is offline Expert Member
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  9. #9
    crossany is offline Senior Member
    Join Date
    Mar 2006
    Posts
    59
    Rep Power
    9

    Default String url="https://192.168.1.127:7071/service/admin/soap";

    I set the URL ="https://192.168.1.127:7071/service/admin/soap" in the java code before but it's also error

  10. #10
    sam
    sam is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    821
    Rep Power
    11

    Default

    are you able to login to the admin console? https://<your-server>:7071/zimbraAdmin ?
    Sam Khavari

    :: :: [ Zimbra ] :: :: [ Bugzilla ] :: :: [ Product Portal ] :: :: [ Wiki ] :: :: [ Downloads ] :: :: [ . ] ::

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. XSD/WSDL Files for the SOAP Server?
    By photoadrian in forum Developers
    Replies: 5
    Last Post: 12-23-2012, 02:32 AM
  2. Postfix problem
    By jimbo in forum Administrators
    Replies: 46
    Last Post: 07-23-2007, 05:24 AM
  3. php CreateAccountRequest via SOAP
    By bookatechie in forum Developers
    Replies: 2
    Last Post: 05-02-2007, 11:28 AM
  4. 3.0 to 4.5.3 Upgrade failed (mysql error)
    By dealt in forum Installation
    Replies: 35
    Last Post: 03-19-2007, 10:30 PM
  5. Problem with SOAP CreateAccountRequest
    By rtanner in forum Administrators
    Replies: 1
    Last Post: 04-21-2006, 06:18 PM

Posting Permissions

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