WEB SERVICE SET PARAMETER: Send XML as text?

I’m maintaining some old code where there was:
WEB SERVICE SET PARAMETER(“XMLIn”;$XmlRoot)

so the code was passing an XML reference in $2.

I’m wanting change, from passing an XML reference, to passing XML as text: like this:
WEB SERVICE SET PARAMETER(“XMLIn”;$XmlText)

I’ve tried the implementation, but when I do the actual WEB SERVICE CALL, I’m getting error:
9910: 4DRT: Error 9910 (SOAP fault. :
The malformed SOAP message received.The processing instruction target matching “[xX][mM][lL]” is not allowed.)

How can I pass xml as text, rather than as a reference?

Did you try to use the third parameter “soapType”? See here for reference https://doc.4d.com/4Dv17/4D/17.2/WEB-SERVICE-SET-PARAMETER.301-4386428.en.html

Regards
Lutz

Hi,

I don’t think you can :frowning:
You’ll have to write your own SOAP client (not that difficult, I have done it a few times).

HTH

Lutz,
Thanks for the suggestion.
I read the documentation on this
The documentation kind of assumes that you have an understanding of SOAP types, and how to use them. I don’t.
Do you know if I could specify XML as text? is this a SOAP type?

You should check the documentation of the SOAP endpoint if there is any or check the contents of the WSDL (again, if there is any).
I just checked our codebase and I’ve found only two occurrences where the third parameter soapType is used:
one as “anyType” and the other as “string”. It would be a bigger effort to look for the docs of this services, so I can’t say anything about the need of the use of this values just now. In the most cases we use WEB SERVICE SET PARAMETER without this optional parameter.

Regards
Lutz

An addition …
We have this code:
<code 4D>
WEB SERVICE SET PARAMETER(“xmlCommunication”;$vtxtAnfrage;“string”)
WEB SERVICE CALL($vtxtURL;"";“communicateNew”;“http://xyz”;Web Service dynamic)

</code 4D>
The variable $vtxtAnfrage contains XML text. The WSDL says:
<wsdl:part name=“xmlCommunication” type=“xsd:string”/>

So the endpoint expects a string …

That look promising: I’ll give that a try, and report back to you.