1

I'm calling a service witch among many other parameters demands an entry like (Taken from soapUI):

  <v110:ReadWorkerRequest>
     <v111:Key v111:type="INITIALS">RKM</v111:Key>
  </v110:ReadWorkerRequest>

How do I get the Zend_Soap_Client to send the type-attribute in the Key element?

As this is just part of a rather big service, I've been creating classes to create the datastructure, like:

class Key {
  public $_ = 'RKM;
  public $type = 'INITIALS';
}

class Body {
  public $ReadWorkerRequest;

  public function __construct() {
    $this->ReadWorkerRequest = new Key();
  }
}

However, I do not even get to sending the request as PHP fails, telling me: "SOAP-ERROR: Encoding: object hasn't 'Key' property"

So my question is, how do I create an object structure, possibly with a subpart created as an Array which will honor this?

Or is the object structure correct, and I need to use classmap or SoapVar (I tried some combinations, but not with any success)

Happy holidays, for those of you who has them! :-)

1 Answer 1

0

I have spent many hours myself trying to solve this problem but the best I could come up with was to use the XSD_ANYXML hack, eg:

$this->ReadWorkerRequest = new SoapVar( '<v111:Key v111:type="INITIALS">RKM</v111:Key>', XSD_ANYXML );

Its a pretty nasty hack though. Hopefully somebody else can provide a better solution.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.