Skip to content

How to force CDATA for a specific SOAP Element? #297

Answered by michabbb
michabbb asked this question in Q&A
Discussion options

You must be logged in to vote

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)…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@michabbb
Comment options

@michabbb
Comment options

Comment options

You must be logged in to vote
4 replies
@mikaelcom
Comment options

@michabbb
Comment options

@mikaelcom
Comment options

@michabbb
Comment options

Answer selected by michabbb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #296 on July 17, 2023 17:15.