I have found some strange behavior with XMLPorts and need help. I am trying to stream the xml port to a blob (instead of a file which is more normal).
The following code does this (TempBlob is Temp Table 99008535):
Customer.SETFILTER("No.",'100000');
IF Customer.FINDFIRST THEN BEGIN
TempBlob."Primay Key" := 1;
TempBlob.INSERT;
TempBlob.Blob.CREATEOUTSTREAM(Streamout);
XMLPORT.EXPORT(XMLPORT::WSTestCustomer,Streamout,Customer);
TempBlob.MODIFY;
TempBlob.Blob.EXPORT('c:\test1.xml',FALSE);
end;
This works fine. The XMLPort is streamed into a blob, then the blob is exported to a file. Now I wanted to to the same thing expect read the blob into a BigText variable. This code here doesn't really work:
Customer.SETFILTER("No.",'100000');
IF Customer.FINDFIRST THEN BEGIN
TempBlob."Primay Key" := 1;
TempBlob.INSERT;
TempBlob.Blob.CREATEOUTSTREAM(Streamout);
XMLPORT.EXPORT(XMLPORT::WSTestCustomer,Streamout,Customer);
TempBlob.MODIFY;
TempBlob.Blob.CREATEINSTREAM(StreamIn);
TestBigText.READ(StreamIn);
TestBigText.GETSUBTEXT(TestText,1);
MESSAGE(TestText);
END;
This message box displays P< not matter what customer filter I use. If someone can help me get this to work then I will have figured out a way to pass actual xml back through web services without use the msxmldom.
By the way the xmlport generates the following file (not that it should matter):
<?xml version="1.0" encoding="UTF-16" standalone="no" ?>
<MyXMLCustomers>
<MyXMLCustomer>
<No>100000</No>
<Name>DONNA MCNEIL</Name>
<City>PORTLAND</City>
</MyXMLCustomer>
</MyXMLCustomers>
0
Answers
jwilder@stonewallkitchen.com
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I can now send actual xml back through my web service!
How do you mark something a ssolved?
jwilder@stonewallkitchen.com
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.