#include "soapH.h" #include "soapmsd_soap_service.nsmap" #include //#include //#include //using namespace std; const char msd_soap_service[] = "http://www.ebi.ac.uk/msd-srv/msdsoap"; int main() { struct soap soap; soap_init(&soap); ns__msdConnectResponse r1; ns__msdResultsetResponse r2; ns__msdQueryResponse r3; ns__msdExecQueryResponse r4; ns__msdGetResultResponse r5; char* statement="select * from WHOUSE2.atom_data where " "atom_id >= 2010000*:f and atom_id <= 2010300*:f"; char* sql = (char*)soap_malloc(&soap,strlen(statement)+1); strcpy(sql, statement); if (soap_call_ns__msdConnect ( &soap, msd_soap_service, "urn:msd_soap_service#msdConnect", "MyConnection","msdsrchd","api2","api255", &r1)) ///* xsd__string conn_name, xsd__string host, xsd__string usern, xsd__string pass, ns__msdConnectResponse * out*/ soap_print_fault(&soap,stderr); else{ std::cout << "\nResult1 is: "; r1._status.print(cout); cout << std::endl; } if (soap_call_ns__msdResultset(&soap, msd_soap_service, "urn:msd_soap_service#msdResultset", "MyConnection","MyQuery","MyResult", &r2)) soap_print_fault(&soap,stderr); else{ std::cout << "\nResult2 is: "; r2._status.print(cout); cout << std::endl; } if (soap_call_ns__msdQuery(&soap, msd_soap_service, "urn:msd_soap_service#msdQuery", "MyConnection","MyQuery","MyResult",sql, &r3)) soap_print_fault(&soap,stderr); else{ std::cout << "\nResult3 is: "; r3._status.print(cout); cout << std::endl; } soap.userid="geoff"; soap.passwd="cc12345678"; if (soap_call_ns__msdExecQuery(&soap, msd_soap_service, "urn:msd_soap_service#msdExecQuery", "MyConnection","MyQuery","MyResult",50, &r4)) soap_print_fault(&soap,stderr); else{ std::cout << "\nResult4 is: "; r4._status.print(cout); cout << std::endl; } if (soap_call_ns__msdGetResult(&soap, msd_soap_service, "urn:msd_soap_service#msdGetResult", "MyConnection","MyQuery","MyResult", &r5)) soap_print_fault(&soap,stderr); else{ for (int i=0;i__size ;i++ ) { std::cout << "Result5 [" << i << "] is: "; r5._out->print(cout); cout << std::endl; } } soap_end(&soap); soap_free(&soap); soap_done(&soap); return 0; } //////////////////////////////////////////////////////////////////////////////// // // XSD schema class hierarchy // //////////////////////////////////////////////////////////////////////////////// xsd__anyType::xsd__anyType() { soap = NULL; // This will be set by gSOAP environment later (upon deserialization or calling soap_new_X() } xsd__anyType::~xsd__anyType() { soap_unlink(soap, this); // Let gSOAP not deallocate this object again if this object was explicitly removed } xsd__anyType*& xsd__anyType::operator[](int i) { static xsd__anyType *p = this; // trick: we don't expect the operator to be applied, but we need a method return p; } void xsd__anyType::print(std::ostream &s) const { s << ""; } xsd__anySimpleType::xsd__anySimpleType() { } xsd__anySimpleType::~xsd__anySimpleType() { } void xsd__anySimpleType::print(std::ostream &s) const { s << ""; } xsd__anyURI::xsd__anyURI() { } xsd__anyURI::~xsd__anyURI() { } xsd__anyURI::xsd__anyURI(char *s) { __item = s; } void xsd__anyURI::print(std::ostream &s) const { s << ""; } xsd__boolean::xsd__boolean() { } xsd__boolean::~xsd__boolean() { } xsd__boolean::xsd__boolean(bool b) { __item = b; } void xsd__boolean::print(std::ostream &s) const { s << ""; } xsd__date::xsd__date() { } xsd__date::~xsd__date() { } xsd__date::xsd__date(char *s) { __item = s; } void xsd__date::print(std::ostream &s) const { s << ""; } xsd__dateTime::xsd__dateTime() { } xsd__dateTime::~xsd__dateTime() { } xsd__dateTime::xsd__dateTime(time_t t) { __item = t; } void xsd__dateTime::print(std::ostream &s) const { s << ""; } xsd__double::xsd__double() { } xsd__double::~xsd__double() { } xsd__double::xsd__double(double d) { __item = d; } void xsd__double::print(std::ostream &s) const { s << ""; } xsd__duration::xsd__duration() { } xsd__duration::~xsd__duration() { } xsd__duration::xsd__duration(char *s) { __item = s; } void xsd__duration::print(std::ostream &s) const { s << ""; } xsd__float::xsd__float() { } xsd__float::~xsd__float() { } xsd__float::xsd__float(float f) { __item = f; } void xsd__float::print(std::ostream &s) const { s << ""; } xsd__time::xsd__time() { } xsd__time::~xsd__time() { } xsd__time::xsd__time(char *s) { __item = s; } void xsd__time::print(std::ostream &s) const { s << ""; } xsd__string::xsd__string() { } xsd__string::~xsd__string() { } xsd__string::xsd__string(char *s) { __item = s; } void xsd__string::print(std::ostream &s) const { s << ""; } xsd__normalizedString::xsd__normalizedString() { } xsd__normalizedString::~xsd__normalizedString() { } xsd__normalizedString::xsd__normalizedString(char *s) { __item = s; } void xsd__normalizedString::print(std::ostream &s) const { s << ""; } xsd__token::xsd__token() { } xsd__token::~xsd__token() { } xsd__token::xsd__token(char *s) { __item = s; } void xsd__token::print(std::ostream &s) const { s << ""; } xsd__decimal::xsd__decimal() { } xsd__decimal::~xsd__decimal() { } xsd__decimal::xsd__decimal(char *s) { __item = s; } void xsd__decimal::print(std::ostream &s) const { s << ""; } xsd__integer::xsd__integer() { } xsd__integer::~xsd__integer() { } xsd__integer::xsd__integer(char *s) { __item = s; } void xsd__integer::print(std::ostream &s) const { s << ""; } xsd__nonPositiveInteger::xsd__nonPositiveInteger() { } xsd__nonPositiveInteger::~xsd__nonPositiveInteger() { } xsd__nonPositiveInteger::xsd__nonPositiveInteger(char *s) { __item = s; } void xsd__nonPositiveInteger::print(std::ostream &s) const { s << ""; } xsd__negativeInteger::xsd__negativeInteger() { } xsd__negativeInteger::~xsd__negativeInteger() { } xsd__negativeInteger::xsd__negativeInteger(char *s) { __item = s; } void xsd__negativeInteger::print(std::ostream &s) const { s << ""; } xsd__nonNegativeInteger::xsd__nonNegativeInteger() { } xsd__nonNegativeInteger::~xsd__nonNegativeInteger() { } xsd__nonNegativeInteger::xsd__nonNegativeInteger(char *s) { __item = s; } void xsd__nonNegativeInteger::print(std::ostream &s) const { s << ""; } xsd__positiveInteger::xsd__positiveInteger() { } xsd__positiveInteger::~xsd__positiveInteger() { } xsd__positiveInteger::xsd__positiveInteger(char *s) { __item = s; } void xsd__positiveInteger::print(std::ostream &s) const { s << ""; } xsd__long::xsd__long() { } xsd__long::~xsd__long() { } xsd__long::xsd__long(LONG64 ll) { __item = ll; } void xsd__long::print(std::ostream &s) const { s << ""; } xsd__int::xsd__int() { } xsd__int::~xsd__int() { } xsd__int::xsd__int(int i) { __item = i; } void xsd__int::print(std::ostream &s) const { s << ""; } xsd__short::xsd__short() { } xsd__short::~xsd__short() { } xsd__short::xsd__short(short h) { __item = h; } void xsd__short::print(std::ostream &s) const { s << ""; } xsd__byte::xsd__byte() { } xsd__byte::~xsd__byte() { } xsd__byte::xsd__byte(char c) { __item = c; } void xsd__byte::print(std::ostream &s) const { s << ""; } xsd__unsignedLong::xsd__unsignedLong() { } xsd__unsignedLong::~xsd__unsignedLong() { } xsd__unsignedLong::xsd__unsignedLong(ULONG64 ull) { __item = ull; } void xsd__unsignedLong::print(std::ostream &s) const { s << ""; } xsd__unsignedInt::xsd__unsignedInt() { } xsd__unsignedInt::~xsd__unsignedInt() { } xsd__unsignedInt::xsd__unsignedInt(unsigned int ui) { __item = ui; } void xsd__unsignedInt::print(std::ostream &s) const { s << ""; } xsd__unsignedShort::xsd__unsignedShort() { } xsd__unsignedShort::~xsd__unsignedShort() { } xsd__unsignedShort::xsd__unsignedShort(unsigned short uh) { __item = uh; } void xsd__unsignedShort::print(std::ostream &s) const { s << ""; } xsd__unsignedByte::xsd__unsignedByte() { } xsd__unsignedByte::~xsd__unsignedByte() { } xsd__unsignedByte::xsd__unsignedByte(unsigned char uc) { __item = uc; } void xsd__unsignedByte::print(std::ostream &s) const { s << ""; } xsd__base64Binary::xsd__base64Binary() { } xsd__base64Binary::~xsd__base64Binary() { } xsd__base64Binary::xsd__base64Binary(char *s) { __size = strlen(s)+1; __ptr = (unsigned char*)s; } void xsd__base64Binary::print(std::ostream &s) const { s << ""; } xsd__hexBinary::xsd__hexBinary() { } xsd__hexBinary::~xsd__hexBinary() { } xsd__hexBinary::xsd__hexBinary(char *s) { __size = strlen(s)+1; __ptr = (unsigned char*)s; } void xsd__hexBinary::print(std::ostream &s) const { s << ""; } array::array() { } array::~array() { } array::array(int n) { __size = n; __ptr = (xsd__anyType**)soap_malloc(soap, n*sizeof(xsd__anyType*)); } xsd__anyType*& array::operator[](int i) { return __ptr[i]; } void array::print(std::ostream &s) const { s << "print(s); else s << ""; s << ">"; } ArrayOfanyType::ArrayOfanyType(){} ArrayOfanyType::~ArrayOfanyType(){} ArrayOfanyType::ArrayOfanyType(int n) { __size = n; __ptr = (xsd__anyType**)soap_malloc(soap, n*sizeof(xsd__anyType*)); } xsd__anyType*& ArrayOfanyType::operator[](int i) { return __ptr[i]; } void ArrayOfanyType::print(std::ostream &s) const { s << "print(s); else s << ""; s << ">"; }