- 论坛徽章:
- 0
|
本帖最后由 taotao_112206_cu 于 2013-09-15 13:17 编辑
struct soap soap;
struct _ns1__jhqqResponse jhRES;
struct _ns1__jhqq *aaa;
int ret = 0;
int hFileID = 0;
// FILE *fp = NULL;
char buffer[5*10240];
memset(buffer, 0x00, sizeof(buffer));
printf("active soap\n");
const char * endPoints = "http://172.160.132.89:8081";
hFileID = open("SG1016120130513091146.xml", O_RDONLY);
if( hFileID == 0)
{
printf("open file failed[%s, %d]\n", strerror(errno), errno);
return -1;
}
ret = read( hFileID, buffer, 7*10240);
// printf("uuuuuuuuuuu= %s\n", buffer);
soap_init(&soap);
aaa = ( struct _ns1__jhqq *)malloc(7*10240+100);
strcpy(aaa->in0, buffer);
// aaa->in0 = buffer;
printf("aaa = %s\n", aaa->in0);
if(soap_call___ns1__jhqq(&soap, endPoints, NULL, aaa, &jhRES) == SOAP_OK )
{
printf("SUCCRSS !!!!!\n");
}
soap_print_fault(&soap, stderr);
printf("Failed !!!!!\n");
printf("nnnnnnnnn[%s]\n", jhRES.out);
free(aaa);
soap_destroy(&soap);
soap_end(&soap);
soap_done(&soap);
return 0;
warning: core file may not match specified executable file.
Core was generated by `./ServPWDServiceClient'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/tls/libc.so.6...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
#0 0x006364a6 in strcpy () from /lib/tls/libc.so.6
(gdb) where
#0 0x006364a6 in strcpy () from /lib/tls/libc.so.6
#1 0x0804915e in main () at main.c:33
struct _ns1__jhqq
{
char *in0; /* required element of type xsd:string */
};
就是 strcpy(aaa->in0, buffer);
|
|