64,649
社区成员
发帖
与我相关
我的任务
分享
struct xsd__CardInfo
{
int *ID;
int len;
};
struct ns__getCardsInfoResPonse
{
struct xsd__CardInfo *__ptr;
};
int ns__getCardsInfo(int size, struct ns__getCardsInfoResPonse *result);
#include"iostream"
#include "soapcalcService.h"
using namespace std;
int main()
{
calcService calc;
int port;
ns__getCardsInfoResPonse result ;
calc.getCardsInfo(10,&result);
for(int i = 0; i < 10; i++)
{
cout << result.__ptr->ID[i]<<endl;
}
cin>>port;
if(calc.run(port))
{
return 0;
}
return 0;
}
int calcService::getCardsInfo(int size, struct ns__getCardsInfoResPonse *result)
{
int *ptr = new int [size];
for(int i = 0; i < size ;i++)
{
ptr[i] = i;
}
xsd__CardInfo *cardInfo = new xsd__CardInfo;
cardInfo->ID = ptr;
result->__ptr = cardInfo;
return SOAP_OK;
}
ns__getCardsInfoResPonse result;
calcProxy calc;
char server[] = "http://localhost:8081";
calc.soap_endpoint = server;
calc.getCardsInfo(10,&result);
for(int i = 0 ;i < 10 ;i++)
{
int temp = result.__ptr->ID[i];
}