Click here to Skip to main content
15,890,282 members

Comments by AmVal (Top 2 by date)

AmVal 12-Jul-11 17:34pm View    
Sorry, that didn't paste in very well... I tried to delete but it's still here.

Will re-post as Answer instead...
AmVal 12-Jul-11 17:26pm View    
Deleted
I'm confused. The CurrencyConverter example I learned from made a call to soap_instantiate for each parameter, which it said was necessary. But when I'm looking at these other examples, I never see any call to soap_instantiate at all. So maybe I should be doing something completely different???

My input parameter is an object of this class, which contains another class element:

class SOAP_CMAC ns1__processServiceCallNumber
{
public:
class ns1__validateServiceCallNumberInput *processServiceCallNumber; /* optional element of type ns1:validateServiceCallNumberInput */
struct soap *soap; /* transient */
public:
virtual int soap_type() const { return 6; } /* = unique id SOAP_TYPE_ns1__processServiceCallNumber */
virtual void soap_default(struct soap*);
virtual void soap_serialize(struct soap*) const;
virtual int soap_put(struct soap*, const char*, const char*) const;
virtual int soap_out(struct soap*, const char*, int, const char*) const;
virtual void *soap_get(struct soap*, const char*, const char*);
virtual void *soap_in(struct soap*, const char*, const char*);
ns1__processServiceCallNumber() : processServiceCallNumber(NULL), soap(NULL) { }
virtual ~ns1__processServiceCallNumber() { }
};


and ns1__validateServiceCallNumberInput is defined like this:

class SOAP_CMAC ns1__validateServiceCallNumberInput
{
public:
char *serviceCallNumber; /* optional element of type xsd:string */
struct soap *soap; /* transient */
public:
virtual int soap_type() const { return 7; } /* = unique id SOAP_TYPE_ns1__validateServiceCallNumberInput */
virtual void soap_default(struct soap*);
virtual void soap_serialize(struct soap*) const;
virtual int soap_put(struct soap*, const char*, const char*) const;
virtual int soap_out(struct soap*, const char*, int, const char*) const;
virtual void *soap_get(struct soap*, const char*, const char*);
virtual void *soap_in(struct soap*, const char*, const char*);
ns1__validateServiceCallNumberInput() : serviceCallNumber(NULL), soap(NULL) { }
virtual ~ns1__validateServiceCallNumberInput() { }
};


So I need to pass my serviceCallNumber input string in (myServiceCallNumber->processServiceCallNumber)->serviceCallNumber = sInput;

But when I try to set that value, after having instantiated the input parameter as follows, it crashes because that inner component doesn't seem to be instantiated. So, I think for this type of 'complex' parameter, I need to do something different for the instantiation. I've been looking at lots of examples... I'll keep looking, but if someone can point to a particular example, or give me some different direction,that would be great.

//instantiate my input paramter
ns1__processServiceCallNumber* myServiceCallNumber;
size_t *pServiceCallNumberSize = new size_t;
*pServiceCallNumberSize = sizeof(ns1__processServiceCallNumber);
myServiceCallNumber = (ns1__processServiceCallNumber*) soap_instantiate(validateServiceCallNumberBinding_->soap, SOAP_TYPE_ns1__processServiceCallNumber,"","",pServiceCallNumberSize);
delete pServiceCallNumberSize;

//call web service, after also instantiating response parameter, not shown...
iRet = validateServiceCallNumberBinding_->__ns1__processServiceCallNumber(myServiceCallNumber, myServiceCallNumberResponse);