No, you cannot retrieve the user password via SOAP.
1)
When I make a soap call like above I get:
"HTTP/1.1 505 HTTP Version Not Supported"
Im sending my SOAP request to: "https://MyZimbraSrv:7071/" using JAVA (javax.net.ssl.SSLSocketFactory).
2)
I am able to open the debug window (https://MyZimbraSrv:7071/?mode=mjsf&gzip=false&debug=1) BUT I can not see my soap calls in it. Is this because my call never reaches a point to be recognized as a SOAP call by Zimbra?
Here is a summary of my Java code:
the syntax is not correct that's because Im using but I have it working o ColdFusion, I posted it just to show you my method of makeing a SOAP call.Code:factory = javax.net.ssl.SSLSocketFactory.getDefault() sock=factory.createSocket("192.168.1.180",7071) sock.startHandshake() sout = sock.getOutputStream() out = java.io.PrintWriter.init(sout) sinput = sock.getInputStream() inputStreamReader = java.io.InputStreamReader.init(sinput) input = java.io.BufferedReader.init(InputStreamReader) //then I save my entire soap call with headers into a variable called "msg" out.println(msg) out.println() out.flush() response = results=input.readLine() ... sock.close()
3)
Where can I find documentation for commands like "$set:debug 1" or "?mode=mjsf&gzip=false&debug=1" or others?
the debug window shows you the requests/responses sent from the Ajax client to the zimbra server. If you are sending requests from your own program, the debug window is of no value.
what is the exact http request/response you send/receive?
Exact request/respose:
REQUEST:
POST /service/admin/soap/ HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8
User-Agent: Test application
Host: mydomain.com:7071
Content-Length: 308
Connection: Keep-Alive
Cache-Control: no-cache
Pragma: no-cache
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header><context xmlns="urn:zimbra"><nonotify/><noqualify/></context></soap:Header><soap:Body><AuthRequest xmlns="urn:zimbraAdmin"><name>m3@mydomain.com</name><password>mypassword</password></AuthRequest></soap:Body></soap:Envelope>
RESPONSE:
HTTP/1.1 500 Internal Server Error
-----------------
Regarding the debug window: I have the debug window open and opened the up the zimbra webmail then tried to open emails, send email,... but I am not getting anything on the debug window.
POST /service/admin/soap/ HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8
User-Agent: Test application
Host: mydomain.com:7071
Content-Length: 308
Connection: Keep-Alive
Cache-Control: no-cache
Pragma: no-cache
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header><context xmlns="urn:zimbra"><nonotify/><noqualify/></context></soap:Header><soap:Body><AuthRequest xmlns="urn:zimbraAdmin"><name>m3@mydomain.com</name><password>mypassword</password></AuthRequest></soap:Body></soap:Envelope>
You need a new line after the last http header
wow ! it worked, im getting a response form Zimbra.
Could you answer my other question as well on my last post:
How can I see some SOAP calls in the debug window? Im runing webmail but nothing comes up on the debug window!
the following works for me:
logout and make sure any existing debug windows are closed
navigate to https://<server>:7071/zimbraAdmin/?mode=mjsf&gzip=false&debug=1
notice the window pops up
login
Hello Hemant.
I am in the same situation as u were some time ago, when u posted the above message.
I am actually confused. By far the web services that I have written or consumed (even document-literal ones), followed this:
Expose a WSDL
Generate stub (a java class)
Use that stub to communicate to web service
We didn't need to use any XML parsing, rather an tool like Apache AXIS or jwsdp use to handle the marshalling and unmarshalling of java objects to and from xml based SOAp packets.
That way, the consumer of web service was concerned only with his JAVA code (or .net or whatever he was coding in), XML SOAP being transparent to him.
Now that Zimbra does not provide WSDL, are you parsing the XML urself? How are you sending the SOAp requests and processing the SOAP responses?
I am sort of stuck and would really appriciate any help in this regard.
Regards
Abhishek
Diamond is a piece of coal that performed well under pressure
I went through this thread, and tried to hit the web service using the soap request as provided by you:
I used the following soap request:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header><context xmlns="urn:zimbra"><nonotify/><noqualify/></context></soap:Header><soap:Body><AuthRequest xmlns="urn:zimbraAdmin"><name>admin@in.apnatek.net</name><password>apnatek123</password></AuthRequest></soap:Body></soap:Envelope>
But got the following error
Exception in thread "main"
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderE xception: unable to find valid certification path to requested target
at com.sun.net.ssl.internal.ssl.Alerts.getSSLExceptio n(Alerts.java:150)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1476)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:174)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:168)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serv erCertificate(ClientHandshaker.java:847)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.proc essMessage(ClientHandshaker.java:106)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoo p(Handshaker.java:495)
at com.sun.net.ssl.internal.ssl.Handshaker.process_re cord(Handshaker.java:433)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRec ord(SSLSocketImpl.java:815)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.perform InitialHandshake(SSLSocketImpl.java:1025)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHa ndshake(SSLSocketImpl.java:1038)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:405)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnect ion.connect(AbstractDelegateHttpsURLConnection.java:170)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStrea m(HttpURLConnection.java:828)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutpu tStream(HttpsURLConnectionImpl.java:230)
at com.apnatek.webservices.SOAP.SOAPClient4XG.main(SOAPClient4XG.java:77)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderE xception: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:221)
at sun.security.validator.PKIXValidator.engineValidat e(PKIXValidator.java:145)
at sun.security.validator.Validator.validate(Validator.java:203)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl. checkServerTrusted(X509TrustManagerImpl.java:172)
at com.sun.net.ssl.internal.ssl.JsseX509TrustManager. checkServerTrusted(SSLContextImpl.java:320)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serv erCertificate(ClientHandshaker.java:840)
... 11 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderE xception: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder. engineBuild(SunCertPathBuilder.java:236)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:194)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:216)
... 16 more
What can be the reason for this?
Last edited by abhishek_agl; 12-03-2006 at 11:42 PM. Reason: making it more readable
Diamond is a piece of coal that performed well under pressure
on your server you probalbly have a self signed SSL certificate. the client library doesn't like the fact that its not passing validation.
this might help:
http://forum.java.sun.com/thread.jsp...sageID=3885112
There are currently 1 users browsing this thread. (0 members and 1 guests)