Send soap request
Hello,
I have a problem with sending soap request.
I get wsdl . The wsdl class bellow
Class Data.SOAP.PrinServ.NotificationRequest Extends (%RegisteredObject, %XML.Adaptor) [ ClassType = "", CompileAfter = Data.SOAP.PrinServ.Lang, Inheritance = right, ProcedureBlock ]
{
Parameter ELEMENTQUALIFIED = 1;
Parameter NAMESPACE = "http://tempuri.org/";
Parameter XMLNAME = "NotificationRequest";
Parameter XMLSEQUENCE = 1;
Property IIN As %String(MAXLEN = "", XMLNAME = "IIN");
Property AccountList As list Of %String(MAXLEN = "", XMLITEMNAME = "string", XMLNAME = "AccountList", XMLPROJECTION = "COLLECTION");
}
The code:
s rq=##class(Data.SOAP.PrinServ.PrintPdfSoap).%New()
set BaseInfo=##class(Data.SOAP.PrinServ.NotificationRequest).%New()
s BaseInfo.IIN=IIN
d BaseInfo.ColvirAccountList.InsertObject(Account)
s rp=##class(Data.SOAP.PrinServ1.PrintResponse).%New()
s rp=rq.PrintNotification(BaseInfo)
my request is missing tag <string xsi:type="s:string">TESTKZ</string>
<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:s='http://www.w3.org/2001/XMLSchema'>
<SOAP-ENV:Body>
<PrintNotification xmlns="http://tempuri.org/">
<Request xmlns:s01="http://tempuri.org/" xsi:type="s01:NotificationRequest">
<IIN xsi:type="s:string">1234567910</IIN>
<AccountList xsi:type="s:string">TESTKZ</AccountList>
</Request>
</PrintNotification>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
The correct request:
<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:s='http://www.w3.org/2001/XMLSchema'>
<SOAP-ENV:Body>
<PrintNotification xmlns="http://tempuri.org/">
<Request xmlns:s01="http://tempuri.org/" xsi:type="s01:NotificationRequest">
<IIN xsi:type="s:string">1234567910</IIN>
<AccountList>
<string xsi:type="s:string">TESTKZ</string>
</AccountList>
</Request>
</PrintNotification>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Comments
(XMLPROJECTION="wrapped");
should separate your items.
Effect of XMLPROJECTION on Collection Properties
| Value of XMLPROJECTION | Effect on Collection Properties |
|---|---|
| "WRAPPED" | The property is projected as an element with subelements; each subelement corresponds to an item of the collection. This is the default for collection properties. |
| "ELEMENT" | Each item in the collection is projected as an element, without being wrapped in the parent property. |
Thank you, the request is correct.
Thank you!