summaryrefslogtreecommitdiffstats
path: root/libcsoap/soap-client.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcsoap/soap-client.c')
-rw-r--r--libcsoap/soap-client.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/libcsoap/soap-client.c b/libcsoap/soap-client.c
index b015a9c..dfb6898 100644
--- a/libcsoap/soap-client.c
+++ b/libcsoap/soap-client.c
@@ -1,5 +1,5 @@
/******************************************************************
-* $Id: soap-client.c,v 1.17 2005/07/27 07:45:40 snowdrop Exp $
+* $Id: soap-client.c,v 1.18 2005/12/19 14:06:16 snowdrop Exp $
*
* CSOAP Project: A SOAP client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -103,6 +103,9 @@ soap_client_invoke(SoapCtx *call, SoapCtx** response, const char *url, const cha
/* Transport via HTTP */
conn = httpc_new();
+ if(!conn){
+ return herror_new("soap_client_invoke", SOAP_ERROR_CLIENT_INIT, "Unable to create SOAP client!" );
+ }
conn->block = soap_client_get_blockmode();
/* Set soap action */
@@ -121,21 +124,21 @@ soap_client_invoke(SoapCtx *call, SoapCtx** response, const char *url, const cha
status = httpc_post_begin(conn, url);
if (status != H_OK) {
- httpc_close_free(conn);
+ httpc_free(conn);
xmlBufferFree(buffer);
return status;
}
status = http_output_stream_write_string(conn->out, content);
if (status != H_OK) {
- httpc_close_free(conn);
+ httpc_free(conn);
xmlBufferFree(buffer);
return status;
}
status = httpc_post_end(conn, &res);
if (status != H_OK) {
- httpc_close_free(conn);
+ httpc_free(conn);
xmlBufferFree(buffer);
return status;
}
@@ -149,21 +152,21 @@ soap_client_invoke(SoapCtx *call, SoapCtx** response, const char *url, const cha
sprintf(start_id, "289247829121218%d", counter++);
status = httpc_mime_begin(conn, url, start_id, "", "text/xml");
if (status != H_OK) {
- httpc_close_free(conn);
+ httpc_free(conn);
xmlBufferFree(buffer);
return status;
}
status = httpc_mime_next(conn, start_id, "text/xml", "binary");
if (status != H_OK) {
- httpc_close_free(conn);
+ httpc_free(conn);
xmlBufferFree(buffer);
return status;
}
status = http_output_stream_write(conn->out, content, strlen(content));
if (status != H_OK) {
- httpc_close_free(conn);
+ httpc_free(conn);
xmlBufferFree(buffer);
return status;
}
@@ -175,7 +178,7 @@ soap_client_invoke(SoapCtx *call, SoapCtx** response, const char *url, const cha
part->content_type, part->transfer_encoding, part->filename);
if (status != H_OK) {
log_error2("Send file failed. Status:%d", status);
- httpc_close_free(conn);
+ httpc_free(conn);
xmlBufferFree(buffer);
return status;
}
@@ -184,7 +187,7 @@ soap_client_invoke(SoapCtx *call, SoapCtx** response, const char *url, const cha
status = httpc_mime_end(conn, &res);
if (status != H_OK)
{
- httpc_close_free(conn);
+ httpc_free(conn);
xmlBufferFree(buffer);
return status;
}
@@ -197,7 +200,7 @@ soap_client_invoke(SoapCtx *call, SoapCtx** response, const char *url, const cha
status = _soap_client_build_result(res, &res_env);
if (status != H_OK) {
hresponse_free(res);
- httpc_close_free(conn);
+ httpc_free(conn);
return status;
}
@@ -221,7 +224,7 @@ soap_client_invoke(SoapCtx *call, SoapCtx** response, const char *url, const cha
hresponse_free(res);
- httpc_close_free(conn);
+ httpc_free(conn);
return H_OK;
}