XML Replay: Difference between revisions
From DataFlex Wiki
Jump to navigationJump to search
no edit summary
No edit summary |
|||
Line 33: | Line 33: | ||
Boolean bOK | Boolean bOK | ||
String sServer sURI | String sServer sURI | ||
Integer iTarg | Integer iTarg<br /> | ||
Get Create U_cXmlDomDocument to hoDoc | Get Create U_cXmlDomDocument to hoDoc | ||
Set psDocumentName of hoDoc to (Value(oInput(Self))) | Set psDocumentName of hoDoc to (Value(oInput(Self))) | ||
Get LoadXmlDocument of hoDoc to bOK | Get LoadXmlDocument of hoDoc to bOK<br /> | ||
If not bOK Begin | If not bOK Begin | ||
Error 0 ("Could not load document" * psDocumentName(hoDoc)) | Error 0 ("Could not load document" * psDocumentName(hoDoc)) | ||
Procedure_Return | Procedure_Return | ||
End | End<br /> | ||
Get DocumentElement of hoDoc to hoMsg<br /> | |||
Get DocumentElement of hoDoc to hoMsg | |||
Get Create U_cXmlDomDocument to hoXML | Get Create U_cXmlDomDocument to hoXML | ||
Send AddChildProcessingInstruction of hoXML "xml" 'version="1.0"' // encoding="utf-8"' | Send AddChildProcessingInstruction of hoXML "xml" 'version="1.0"' // encoding="utf-8"' | ||
Get CreateDocumentElementNS of hoXML "http://schemas.xmlsoap.org/soap/envelope/" "soap:Envelope" to hoEnv | Get CreateDocumentElementNS of hoXML "http://schemas.xmlsoap.org/soap/envelope/" "soap:Envelope" to hoEnv | ||
Get AddElement of hoEnv "soap:Body" "" to hoBody | Get AddElement of hoEnv "soap:Body" "" to hoBody | ||
Get AppendNode of hoBody hoMsg to hoMsg | Get AppendNode of hoBody hoMsg to hoMsg<br /> | ||
Send ClearHeaders of oTfr<br /> | |||
Send ClearHeaders of oTfr | |||
Set psAcceptTypes of oTfr to "text/*" | Set psAcceptTypes of oTfr to "text/*" | ||
Set psContentTypeSent of oTfr to "text/xml; charset=UTF-8" | Set psContentTypeSent of oTfr to "text/xml; charset=UTF-8" | ||
Get AddHeader of oTfr "SOAPAction" ('"' + Value(oOperation(Self)) + '"') to bOk | Get AddHeader of oTfr "SOAPAction" ('"' + Value(oOperation(Self)) + '"') to bOk<br /> | ||
Get Value of oServer to sServer | Get Value of oServer to sServer | ||
Get Value of oURI to sURI | Get Value of oURI to sURI | ||
Set piRemotePort of oTfr to (Value(oPort(Self))) | Set piRemotePort of oTfr to (Value(oPort(Self)))<br /> | ||
Get HttpPostXmlNode of oTfr sServer sURI hoXML to hoXMLResponse<br /> | |||
Get HttpPostXmlNode of oTfr sServer sURI hoXML to hoXMLResponse | |||
If (hoXmlResponse=0) Set Value of oReturnedXML to "NO RESPONSE" | If (hoXmlResponse=0) Set Value of oReturnedXML to "NO RESPONSE" | ||
Else Set Value of oReturnedXML to (psXml(hoXmlResponse)) | Else Set Value of oReturnedXML to (psXml(hoXmlResponse))<br /> | ||
Send Destroy of hoXML | Send Destroy of hoXML | ||
If hoXMLResponse Send Destroy of hoXMLResponse | If hoXMLResponse Send Destroy of hoXMLResponse<br /> | ||
End_Procedure // InvokeService | End_Procedure // InvokeService |