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 !
could you give me a example
I don't konw what your mean
could you give me a example thank you
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><soap:Detail><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></soap:Detail></soap:Fault></soap:Body></soap:Envelope>
anybody can tell me why
I crazy !
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