求肋万能的CCRUN,导入WSDL接后后报很多错误,请问该如何处理?
您好,这是通过webservice 引用wsdl后自动生成的代码,编译时会报很多错误,不知道怎么解决?求万能的CCRUN帮帮小虾米吧,甲方催我赶快弄完.我的IDE是BCB6
__interface INTERFACE_UUID("{CEE48BCE-67F1-EE29-5D83-A807DD1B1509}") CommService : public IInvokable
{
public:
virtual GetCurrentDispatchInfoResponse GetCurrentDispatchInfo(const GetCurrentDispatchInfo parameters) = 0;
virtual SetShipperWeightsResponse SetShipperWeights(const SetShipperWeights parameters) = 0;
virtual SetConsigneeWeightsResponse SetConsigneeWeights(const SetConsigneeWeights parameters) = 0;
virtual SetBusinessDataResponse SetBusinessData(const SetBusinessData parameters) = 0;
virtual GetLastDispatchInfoResponse GetLastDispatchInfo(const GetLastDispatchInfo parameters) = 0;
virtual GetDispatchStatusResponse GetDispatchStatus(const GetDispatchStatus parameters) = 0;
virtual EnterShipAreaResponse EnterShipArea(const EnterShipArea parameters) = 0;
virtual ExitShipAreaResponse ExitShipArea(const ExitShipArea parameters) = 0;
virtual EnterConsigneeAreaResponse EnterConsigneeArea(const EnterConsigneeArea parameters) = 0;
virtual ExitConsigneeAreaResponse ExitConsigneeArea(const ExitConsigneeArea parameters) = 0;
virtual GetAccessHistoryResponse GetAccessHistory(const GetAccessHistory parameters) = 0;
};
typedef DelphiInterface<CommService> _di_CommService;
下面是报错:
[C++ Error] CommService.h(34): E2462 'virtual' can only be used with non-template member functions
[C++ Error] CommService.h(34): E2303 Type name expected
[C++ Error] CommService.h(34): E2139 Declaration missing ;
一共有26个错,基本上都是类似这三个错误.
这个是WSDL的地址:http://cstkwjk.xicp.net:8100/CommService?wsdl
wsdl interface webservice c++
[解决办法]
XE4下导入,直接没有任何错。C6一大堆错误
#ifndef CommServiceH
#define CommServiceH
#include <System.hpp>
#include <InvokeRegistry.hpp>
#include <XSBuiltIns.hpp>
#include <SOAPHTTPClient.hpp>
namespace NS_CommService {
class SOAP_REMOTABLE_CLASS BusinessData2;
class SOAP_REMOTABLE_CLASS BusinessData;
class SOAP_REMOTABLE_CLASS AccessHisotry2;
class SOAP_REMOTABLE_CLASS AccessHisotry;
typedef DynamicArray<AccessHisotry2*> ArrayOfAccessHisotry; /* "http://schemas.datacontract.org/2004/07/AntennaCommService"[GblCplx] */
...
__interface INTERFACE_UUID("{CEE48BCE-67F1-EE29-5D83-A807DD1B1509}") CommService : public IInvokable
{
public:
virtual BusinessData2* GetCurrentDispatchInfo(const UnicodeString plateNo) = 0;
virtual int SetShipperWeights(const UnicodeString plateNo, const double tare, const double grossWeight) = 0;
virtual int SetConsigneeWeights(const UnicodeString plateNo, const double tare, const double grossWeight) = 0;
virtual int SetBusinessData(const UnicodeString plateNo, const BusinessData2* businessData) = 0;
virtual BusinessData2* GetLastDispatchInfo(const UnicodeString plateNo) = 0;
virtual unsigned char GetDispatchStatus(const UnicodeString plateNo) = 0;
virtual int EnterShipArea(const UnicodeString plateNo) = 0;
virtual int ExitShipArea(const UnicodeString plateNo) = 0;
virtual int EnterConsigneeArea(const UnicodeString plateNo) = 0;
virtual int ExitConsigneeArea(const UnicodeString plateNo) = 0;
virtual ArrayOfAccessHisotry GetAccessHistory(const UnicodeString startTime, const UnicodeString endTime) = 0;
};
typedef DelphiInterface<CommService> _di_CommService;
_di_CommService GetCommService(bool useWSDL=false, System::String addr= System::String(), Soaphttpclient::THTTPRIO* HTTPRIO=0);
}; // NS_CommService
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace NS_CommService;
#endif
#endif // CommServiceH