-
dear all, eBay had another great idea to make developers crazy 😕 and I have no idea how to solve this with your project, so I please need some help/advise. based on ebay WSDL I am able to generate the classmap and create a request like this: <SOAP-ENV:Body>
<ns1:ReviseFixedPriceItemRequest>
<ns1:Item>
<ns1:Description><!DOCTYPE html> <!--suppress HtmlFormInputWithoutLabel
--> <html> <head> <meta charset="UTF-8"/>
<title>Kunde</title> <meta name="viewport"
content="width=device-width,initial-scale=1"/> <link rel="stylesheet"...................
</ns1:Description>
</ns1:Item>
</ns1:ReviseFixedPriceItemRequest>
</SOAP-ENV:Body> but ebay forces us (next month) to send this request like that: <SOAP-ENV:Body>
<ns1:ReviseFixedPriceItemRequest>
<ns1:Item>
<ns1:Description>
<![CDATA[
<!DOCTYPE html> <!--suppress HtmlFormInputWithoutLabel --> <html> <head> <meta charset="UTF-8"/>
<title>Kunde</title> <meta name="viewport" content="width=device-width,initial-scale=1"/> <link rel="stylesheet"...................
]]>
</ns1:Description>
</ns1:Item>
</ns1:ReviseFixedPriceItemRequest>
</SOAP-ENV:Body> and sadly I have absolutely no clue how to make this work. here's the latest trading WSDL of ebay. thanks !!! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
the WSDL generator creates a file called "ItemType.php" which contains this method: public function setDescription(?string $description = null): self
{
// validation for constraint: string
if (!is_null($description) && !is_string($description)) {
throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($description, true), gettype($description)), __LINE__);
}
$this->Description = $description;
return $this;
} I tried now this hack: public function setDescription(?string $description = null): self
{
// validation for constraint: string
if (!is_null($description) && !is_string($description)) {
throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($description, true), gettype($description)), __LINE__);
}
$this->Description = new \SoapVar('<ns1:Description><![CDATA['.$description.']]></ns1:Description>', XSD_ANYXML);
return $this;
} this generates this request: <SOAP-ENV:Body>
<ns1:ReviseItemRequest>
<ns1:Item>
<ns1:Description>
<![CDATA[test description]]>
</ns1:Description>
</ns1:Item>
</ns1:ReviseItemRequest>
</SOAP-ENV:Body> I don´t really like this "hack" because:
// from this
/*
* @var string|null
*/
protected ?string $Description = null;
// to this
/*
* @var string|null|SoapVar
*/
protected $Description = null; @mikaelcom in case you have a better idea or solution for this, please let me know 🙏 😞 |
Beta Was this translation helpful? Give feedback.
the WSDL generator creates a file called "ItemType.php" which contains this method:
I tried now this hack: