Import Blob to XMLPort from Webservice

G8torG8tor Member Posts: 29
edited 2012-02-09 in NAV Three Tier
Hello. Im beginner in Nav and I have been assigned to convert form to page. When I convert to page the xml will not import to the XMLport like it did with the form.
What is the reason for that? Does anyone have solution for this?
- - - - - -- - - - - -- - - - - - - - - - -- - - - - -- - - - - - -- - - - - - -- - - - -- - - - - - -- - - - - - -- - - - -
Name DataType Subtype Length
ReadyXMLDoc Automation 'Microsoft XML, v4.0'.DOMDocument 40
XMLDoc Automation 'Microsoft XML, v4.0'.DOMDocument 40
XMLHTTP Automation 'Microsoft XML, v4.0'.XMLHTTP 40


XMLHTTP.open('GET',Url,FALSE,User,Password);
XMLHTTP.send(); // send url to get an answer
IF (XMLHTTP.status = 200) THEN BEGIN // answer is OK
IF ISCLEAR(XMLDoc) THEN
IF NOT CREATE(XMLDoc) THEN
ERROR(Text000);
XMLDoc.async:=FALSE;
XMLDoc := XMLHTTP.responseXML; // load the answer #02
CLEAR(TempTable);
TempTable.CALCFIELDS(Picture);
TempTable.Picture.CREATEOUTSTREAM(OutStreamMessage);
TempTable.Picture.CREATEINSTREAM(InStreamMessage);
IF ISCLEAR(ReadyXMLDoc) THEN
CREATE(ReadyXMLDoc);
IF NOT RemoveNamespace(XMLDoc,ReadyXMLDoc) THEN // remove namespace
ERROR(Text003,Url);
ReadyXMLDoc.save(OutStreamMessage); // save answer to an outstream
XmlCollectorPort.SETSOURCE(InStreamMessage);
IF NOT XmlCollectorPort.IMPORT THEN // import the data
ERROR(Text001)
// Here comes my error

Comments

  • SavatageSavatage Member Posts: 7,142
    We don't use webservices but maybe this can help:
    In the pre-SP1 version of Microsoft Dynamics NAV 2009, you could not have a BLOB field on any page that you exposed as a Web Service. In Microsoft Dynamics NAV 2009 SP1, the content of the BLOB is not transferred to the Web service consumer. The field is ignored.
    http://msdn.microsoft.com/en-us/library/ee414220.aspx
  • G8torG8tor Member Posts: 29
    Thanks Savatages for the reply. This is probably the reason.

    But how can I do this so the XML port will import xml. How can I catch the XML from instream if I cannot use BLOB to the instream?
    Can anyone show me an example?
Sign In or Register to comment.