web service - Load Request and retrieve large xml message

zyroseven
Member Posts: 20
Hi, i have a requirement to build a web service that should load a request from an xml message and retrieve very large xml message that will be build according to the request, and will have about 20 possible structures. For the request i am thinking of using 'Microsoft XML, v3.0'.DOMDocument Automation, but i have no idea how to make the response. Anyone with experience in this scenario? Any information will be great because i have no experience with web services.
many thanks
many thanks
0
Comments
-
ok, i'm beginner too but I'm working with webservice at the moment. You can use XMLHTTP to get this job done.
For more information, take a look at this great example :
http://www.mibuso.com/dlinfo.asp?FileID=539
hope this helps0 -
thanks nXqd, i will take a look in your suggestion0
-
Hi,
would this topic exposing webservices through codeunit and xmlports be useful, maybe?
http://blogs.msdn.com/b/freddyk/archive ... stuff.aspx0 -
Hi Dan77, thank you for your reply. This could be a solution but my problem is that i have to retrieve different kinds of xml files, so xmlport is not really an option unless i could retrieve plain text maybe? Will investigate this option0
-
I have not been involved into some recent devs we made to exchange with some portal here, but our guys met pretty much all the known needs with this technique.
I would be glad to send you more of that stuff, if it can help, but I can't on my own
Good luck0 -
If you do not know the structure before import, you can use BigText parameter in the WS function. Than you can process it as you want, e.g. check which structure was sent and stream it into correct XMLPort throuh code.0
-
Hi Kine, the problem is to handle the response, because it can have different structures :?
Thanks0 -
Again, you can send the data back through BigText parameter which is VAR (Passed by refference). Than you can only stream the correct XMLPort into this bigtext variable and you are done...0
-
Thanks kine, sorry i didn't understood at first but i am a bit confused since this is a new subject for me :oops:
Your help has been great (an example would be even better [-o< )
Thanks0 -
See e.g. this: http://blogs.msdn.com/b/freddyk/archive ... vices.aspx
it is for image, but you can modify it to not send binary data encoded into base64, but just send/receive any XML you want...
Or this: http://blogs.msdn.com/b/freddyk/archive ... -of-3.aspx
BigText parameter is used to return the result.0 -
Brilliant Kine, just what i needed! \:D/0
-
Well, something is still confusing me :-k
How can i use the xml port for response if i dont know the structure it should have? Can it be an empty xmlport? Basically all i want to do is to pick up an 'Microsoft XML, v3.0'.DOMDocument structure and send it to xmlport so it can be returned by the webservice. Because this xml dom structure can be created in about 40 different structures its not reliable to build 40 different xml ports (one for each structure) and test evertything etc, so i must find a solution to "wrap" the xml dom document and return it from the web service.0 -
Of course, you cand create the xml through XML Dom or 40 XML Ports. All depends on the complexity and other things around. That's on you. E.g. for me having 40 XML Port could be much better for support and changes than maintain codeunit creating 40 different structures by code full of conditions and other things. But again, I do not know the requirements.0
-
There is also a easy way to use dotnet to base64 encode the file into the bigtext variable.
For example, if I have the bigtext variable Document the code could beTempFile.CREATETEMPFILE; TempFileName := TempFile.NAME; TempFile.CLOSE; TempFile.TEXTMODE(FALSE); TempFile.CREATE(TempFileName); TempFile.CREATEOUTSTREAM(OutStr); DocumentStore.Blob.CREATEINSTREAM(InStr); COPYSTREAM(OutStr,InStr); TempFile.CLOSE; Document.ADDTEXT( ServerConvert.ToBase64String( ServerDocumentFile.ReadAllBytes(TempFileName))); ServerDocumentFile.Delete(TempFileName);
where the dotnet variables areName DataType Subtype Length
ServerConvert DotNet 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Convert
ServerDocumentFile DotNet 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.IO.File________________________________
Gunnar Gestsson
Microsoft Certified IT Professional
Dynamics NAV MVP
http://www.dynamics.is
http://Objects4NAV.com0 -
Thanks for the responses, the thing is that i already have the codeunit that creates the 40 different xml structures using XML DOM automation and is used in a integration via Message Queues, i just need to change for integration with web services. I just dont understand how can i pass a xml dom to a xmlport, what has to be done in the xmlport because the same xmlport needs to receive 40 different XML DOM files. Because of this i can't define any structure in the xml port, so have no idea how to handle it. :-k0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions