XML Encoding from Business One - Unable to Read in a 3rd Party APP

Hi:
I have created an Add-On app that produces an XML document file when a new item is created or an existing item is updated. However, the 3rd party app that I am trying to integrate into is unable to read this XML. After doing some research, the following appears to be the issue.
SBO produces the data with UTF-16 which is a double byte encoding for XML's. The 3rd party app that I have appears to be able to handle only single byte encoding formats such as UTF-8 or ISO-8859-1.
I would like to know if there is a way in SDK to convert the output XML format to a single byte encoding such as ISO-8859-1. Can anyone please tell me how to achieve that in my Add-On code?
Thank you.
Kushal Dutta

Hi Kushal,
You can use a XLST transformation to convert from UTF-16 to UTF-8.
The coding goes something like this:
XmlReader xmlRdr = XmlReader.Create(new StringReader(sXML));
XmlWriterSettings xmlWtrSettings = new XmlWriterSettings();
xmlWtrSettings.Encoding = Encoding.Unicode;
XmlWriter xmlWtr = XmlWriter.Create(sOutFile, xmlWtrSettings);
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load(sTransformFile);
xslt.Transform(xmlRdr, xmlWtr);
xmlWtr.Flush();
xmlWtr.Close();
xmlRdr.Close();
Where sXML is the XML string generated by the SBO GetAsXML method, sOutFile is the path and filename where the transformed XML will be created and sTransformFile is the path of the XLST file.
Assuming that you wish to retain the same XML structure as before, the XLST file should look something like the following:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
     <BOM>
          <xsl:for-each select="BOM/BO">
          <BO>
               <AdmInfo>
                    <Object>
                         <xsl:value-of select="AdmInfo/Object"/>
                    </Object>
               </AdmInfo>
               <ORDR>
                    <xsl:for-each select="ORDR/row">
                    <row>
                         <DocEntry>
                              <xsl:value-of select="DocEntry"/>
                         </DocEntry>
                         <DocNum>
                              <xsl:value-of select="DocNum"/>
                         </DocNum>
                         <DocDate>
                              <xsl:value-of select="DocDate"/>
                         </DocDate>
                         <DocDueDate>
                              <xsl:value-of select="DocDueDate"/>
                         </DocDueDate>
                         <DocStatus>
                              <xsl:value-of select="DocStatus"/>
                         </DocStatus>
                         <Cancelled>
                              <xsl:value-of select="CANCELED"/>
                         </Cancelled>
                         <CardCode>
                              <xsl:value-of select="CardCode"/>
                         </CardCode>
                         <CardName>
                              <xsl:value-of select="CardName"/>
                         </CardName>
                         <NumAtCard>
                              <xsl:value-of select="NumAtCard"/>
                         </NumAtCard>
                    </row>
                    </xsl:for-each>
               </ORDR>
               <RDR1>
                    <xsl:for-each select="RDR1/row">
                    <xsl:sort select="LineNum" />
                    <row>
                         <LineNum>
                              <xsl:value-of select="LineNum"/>
                         </LineNum>
                         <ItemCode>
                              <xsl:value-of select="ItemCode"/>
                         </ItemCode>
                         <Dscription>
                              <xsl:value-of select="Dscription"/>
                         </Dscription>
                         <Quantity>
                              <xsl:value-of select="Quantity"/>
                         </Quantity>
                         <WhsCode>
                              <xsl:value-of select="WhsCode"/>
                         </WhsCode>
                         <BaseType>
                              <xsl:value-of select="BaseType"/>
                         </BaseType>
                         <BaseEntry>
                              <xsl:value-of select="BaseEntry"/>
                         </BaseEntry>
                         <BaseLine>
                              <xsl:value-of select="BaseLine"/>
                         </BaseLine>
                         <FreeTxt>
                              <xsl:value-of select="FreeTxt"/>
                         </FreeTxt>
                    </row>
                    </xsl:for-each>
               </RDR1>
          </BO>
          </xsl:for-each>
     </BOM>
</xsl:template>
</xsl:stylesheet>
The above example shows a XLST transform for the sales order document type. This example is for use with the xet_ValidNodesOnly setting for the XmlExportType company property. If you are using a different XmlExportType setting then the XLST will be slightly different but the principal is the same. For simplicity, I have shown only a cut-down list of the fields from the sales order but other fields and tables can be included (assuming that they are in the original XML from SBO).
Kind Regards,
Owen
P.S. Sorry for the lack of indentation on the XML file. It was there when I created this post but the forum removes the indentation.

Similar Messages

  • XML Encoding from SBO - Unable to Read in a 3rd Party APP

    Hi:
    I have created an Add-On app that produces an XML document file when a new item is created or an existing item is updated. However, the 3rd party app that I am trying to integrate into is unable to read this XML. After doing some research, the following appears to be the issue.
    SBO produces the data with UTF-16 which is a double byte encoding for XML's. The 3rd party app that I have appears to be able to handle only single byte encoding formats such as UTF-8 or ISO-8859-1. Can anyone please tell me whether it is possible to change the encoding format in my Add-On code?
    Thank you.
    Kushal Dutta

    Kushal,
    The forum that you have posted your question in is for questions related to the SAP Business One Integration for SAP NetWeaver.  Your question seems to be related to the SAP Business One SDK and should be posted in the SAP Business One SDK Discussion Forum.
    Eddy

  • Unable to read information of application in app store. Still can download but unable to read the application infor before downloading

    Hi,
    Please help, unable to read information of application in app store. Still can download but unable to read the application infor before downloading.
    I'm using iphone4, ios 6

    Yes it sounds like your application could be corrupt.
    First I would make sure you don't have a program like backup software or virus protection trying to read the files when you try to start the application. If not,
    Do you have any backups or data exports? If so, I would try to restore them for the application
    If you do what EsbHelper suggests, you will have to recreate the database. I think he is missing a few steps.
    If you are going to try to recreate the application, you need to copy your outline rules files calc scripts and report scritps (.otl, CSC, REP and rul files) to s saved directory.
    If you delete the directory using the file system, you orphan things in the security file. It's better to try to do it from EAS.
    Once it has been deleted, and recreated from EAS, then copy back in the objects. You will have everything but data and security. those will have to be recreated.
    As aI said first, the best way to do this is from some sort of backup. othersiwe it can get a bit messy

  • I recently purchased a 4S. I now have 2 files in my iCloud both with my name. One from my 3gs and one from my 4S. The problem is the data history of all my games and 3rd party apps did not transfer over to my 4S. Is there a way to merge the two in icloud?

    I backed up my 3gs to the iCloud and when I synced my 4S, it did not transfer my game histories or my 3rd party app histories. When I look at my iCloud storage, it shows both phones under the same name. Is there a way to merge them together in iCloud? I tried adding the account to my 4S but since they are both named the same, it says I already have that account added! Help!!

    Welcome to the Apple Community.
    Assuming you have finished with your old backup.....
    You can see what your iCloud storage is used for and delete any unwanted content at settings > iCloud > backup & storage > manage......

  • How can I restore 3rd party app data from my backup in the cloud

    First a brief history. I use the iCloud to backup my iPad 2 and hardly ever synch it to itunes on my computer. I got the new iPad and restored the backup of my iPad 2 onto it.  All was fine except that an issue I had on my iPad 2's Safari had transferred over to my new iPad. That's is for another discussion. Anyhow I went to the genius bar and they said to just setup my new iPad as a new device and then manually install everything back on it. Stuff like mail, contacts, etc, would be reloaded from the cloud. So I did and I noticed that one of my 3rd party apps, MadPad, had none of my saved data. Does anyone know of a way to restore 3rd party app data from the iCloud? Is there some sort of utility out there that would do this?  I don't want to restore it from my previous iPad 2 backup because it will reintroduce the Safari problem back onto my new iPad.
    Thanks!

    Assuming that you even have a backup with the data in it, you have no choice but to use a backup in order to restore that data. That is the idea behind backing up to iCloud. If that is the only backup that you have - then that is the one that you have to use.
    But if the backup is bad - or had corrupt data - then you will end up with the corrupt data again. You cannot selectively restore app data from a backup. you restore all settings and data - or nothing at all.

  • I have installed 10.8.5 and now am unable to install 3rd party apps, like weather bug.

    MACBOOK AIR OS X 10.8.5.
    It is going from a great experience to now almost wishing I would have bought another PC.  How hare is it to install a 3rd party app.  I was running WEATHERBUG just fine with 10.8.2.  All I have read about 10.8.5 is that it has fixed abunch of bugs.  Yeah right.

    I am trying to install "WEATHERBUG"  Weatherbug was allowed to run just fine on earlier versions of MOUNTAIN LION.  10.4 and later won't allow this 3rd party app to download.
    WeatherBug Alert for Mac helps you plan your day with confidence by putting severe weather alerts and your live temperature on your desktop.
    Features
    The most reliable weather information found anywhere.
    Severe weather alerts to help protect you and your family.
    One click access to radar, forecasts and more on WeatherBug.com
    Installation Intructions
    Download zip file.
    Copy file to Applications folder.
    Run the app.
    System Requirements
    Mac OS X version 10.4 or later
    Internet connection
    Support
    For support or to provide feedback on WeatherBug Alert for Mac, please visit the WeatherBug Alert Forum
    Click here for the OS X 10.3.9 Compatible Version
    FREE DOWNLOAD 
    WeatherBug Alert for Mac helps you plan your day with confidence by putting severe weather alerts and your live temperature on your desktop.
    Features
    The most reliable weather information found anywhere.
    Severe weather alerts to help protect you and your family.
    One click access to radar, forecasts and more on WeatherBug.com
    Installation Intructions
    Download zip file.
    Copy file to Applications folder.
    Run the app.
    System Requirements
    Mac OS X version 10.4 or later
    Internet connection
    Support
    For support or to provide feedback on WeatherBug Alert for Mac, please visit the WeatherBug Alert Forum
    Click here for the OS X 10.3.9 Compatible Version
    FREE DOWNLOAD 
    When I click install WEATHERBUG from the FINDER it get this message.
    "WeatherBug Alert" can't be opened because it is from an unidentified developer. 
    Your security preferances allow installation of only apps from the Mac App Store and identified developers.
    Safari downloaded this file today at 7:33 AM from wdownload.weatherbug.com.

  • How do i print sms messages from my iphone without a 3rd party app?

    How do I print a complete SMS message from my iphone without using a 3rd party app?

    If you have an AirPrint compatible printer, or you have a print app, then you could take a screenshot of each page of the message and then print them. Otherwise, there is no native solution to print SMS messages on the iPhone.

  • Should 3rd party app installed from app store has admin or wheel in info box?

    I installed a free program from the app store called Kitabu (an epub reader). Click on the info & it said wheel. I thought only programs came with the mac by default will have wheel and all other programs (ex: iWork, microsolf office) will have admin instead--which they do, I checked. Is this normal for 3rd party app to have wheel group?
    Also the quick look plugin in this program (kitabu) works fine when I 1st installed it (quick look & preview function can view page cover of epub books). Then it stopped working. Is it the program fault or my mac?

    CrownPixel wrote:
    Also the quick look plugin in this program (kitabu) works fine when I 1st installed it (quick look & preview function can view page cover of epub books). Then it stopped working. Is it the program fault or my mac?
    Either or.
    Trash the program's plist file which is located inside /Library/Preferences.  Repair permissions, restart your computer and empty the trash.

  • Query: Selective Transferring of old data (3rd party app) from old iPhone

    Hello all.
    I am collecting my new iPhone 3GS tomorrow
    (and) I want only to add some, and not all the 3rd party apps (from App Store) that was with my old iPhone, in particular, Notes+
    I know if before I perform a software restore or upgrade, iTunes will perform a back up of the phone, and if I insert a new iPhone, and choose the same name, e.g. "howwow iPhone", it will restore all the apps and data into the new phone.
    But if I treat this new 3GS phone as a new phone, e.g. I name it "My 3GS iPhone" and add the Notes+ app, will all the data inside be copied into the new phone?
    My main 2 aims are to only add some apps I need (like Notes+) to the new phone and still able to keep the data/notes in it, without re-adding manually.
    Thanks and cheers

    There is no way to selectively restore certain data from the backup to the new iPhone - it's all or none. If you set it up as a new phone, none of the old data will be transferred. Alternatively, you could set it up from the backup, then delete all of the unwanted stuff.

  • Outlook "The Operation Failed" - Sending emails from 3rd Party Apps

    I have an issue similar to this one
    http://community.office365.com/en-us/f/158/t/272002.aspx
    This started a few weeks ago for some users. Users cannot send emails generated from 2 3rd party apps. They get the error "The Operation has failed".
    Not all users are affected but the only solution is to turn on Cached Mode in Outlook.

    Hi,
    I'm marking the reply as answer as there has been no update for a couple of days.
    If you come back to find it doesn't work for you, please reply to us and unmark the answer.
    Regards,
    Melon Chen
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click
    here

  • 3rd party apps on iPod Touch starting February - Now I'll get one

    Nice moves Apple. (3rd party apps on iPod Touch and iPhone + DRM-tunes for .99$)
    http://www.apple.com/startpage/
    Now you're finally convincing me to get a Touch. By February.
    Thanks for listening to popular demand.

    I hope they can make the date. They have a big task in front of them especially for the iPhone as a bug or virus can take down the Cell system if the proper safe guards are not in place.
    I bet Apple has been working on this even before they launched the iPhone, but did not want to tell anyone as the development cycle was going to be so long.
    Apple has always prided themselves on having the best platforms for porting applications. Going away from this is unlikely, but the iPhone and iPod touch took them in a direction that is more complicated than a PC on the internet.
    For those that have wanted the iPod touch or Iphone to have more PDA features, I think this move by Apple will clearly put them into that market. The only issue I see is getting directly into the memory to store documents to support the applications. You used to be able to do on older iPods.
    Anyway, great job Apple you have restored my faith in you following the right path.

  • 3rd party apps from someone other then Apple

    Does anyone now if you can get 3rd party apps without jail braking and without using Apples application store. I found a website that offers apps that I really want and was very disappointed to see none of the in the Apps store and dont know why nobody made them or offered them there. For $24.99 I can get all these apps that I was really looking forward to seeing in the apps store but werent:
    NES System : Nintendo with all the games
    Customization : Were I can custom every aspect of the I-Phone from I-cons to backgrounds
    Screen shot : A app where I can take a picture of anything that my I-Phone is viewing at that time like from a game or a website ETC.
    Video Recorder : I cant believe there was no video recorder in the apples web app release it is just something every phone should have
    MMS : Picture messaging, I mean I dont know how many times I recieve a picture message and have to wait till I get home to go on my computer to go to a website just to see them. How long it takes also with normal broadband just to see a simple picture.........This is a must have app
    Ringtone: Now all you have to do is select a song from your music library and put it to you contacts that easy no cutting or editing it down to size, no extra programs to make them with and no money to spend to make them
    Also much more that I dont feel like describing like:
    Instant Messenger
    YouTube Downloader
    Books
    VNC
    <post edited by host>

    Wow don't try to send a MMS to someones cell phone from the e-mail option this was a nightmare. I tried it to see if it would work and I received a message that the attempt didn't succeed so it kept trying and trying automatically. Then I get a phone call from the person I sent it to telling me it work but for me to quit sending it. I said I only sent it once then he said I have like 15 already so I check out my phone and it is really warm I looked at it and the battery went from fully full to a little less then half empty. So I am like what the heck so I go into my e-mail account and I see there is an e-mail demon meaning there was an attempt to send a e-mail but it didn't succeed. Normally when this happens it will make another try just to make sure it wasn't a service error well apparently my cell phone is continuing to retry to send the message so I have the phone trying my e-mail account trying while the person who the message is being sent to is receiving everyone........So I had to delete every message being sent on my e-mail account, I had to delete my E-mail account on my phone, and I had to shut it off for 30 minutes to see if this works it not I don't know what to do and my nightmare continues as well for the person who's phone keeps blowing up with the MMS message and I am wasting all of his text on his plan.......
    Thanks for the bad advice

  • How to Open OpenFileDiologe Box  from Business One

    Hi....
            I want to Select .txt File From Required Location. on click event of Button.
    Please Help

    Hi venkat,
    use the following code on item pressed event..
    Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
    Select Case pVal.ItemUID
    Case "Btnbrowse"                   
    Me.OpenFile()
    end select
    Private Sub OpenFile(ByRef BubbleEvent As Boolean)
    Try
    ShowFolderBrowserThread = New Threading.Thread(AddressOf ShowFolderBrowser)
    If ShowFolderBrowserThread.ThreadState = ThreadState.Unstarted Then ShowFolderBrowserThread.SetApartmentState(ApartmentState.STA)
    ShowFolderBrowserThread.Start()
    ElseIf ShowFolderBrowserThread.ThreadState = ThreadState.Stopped Then
    ShowFolderBrowserThread.Start()
    ShowFolderBrowserThread.Join()
    End If
    Catch ex As Exception
    sbo_application.MessageBox("OpenFile" & ex.Message)
    End Try
    Private Sub ShowFolderBrowser()
    Dim MyTest As New OpenFileDialog
    Dim MyProcs() As System.Diagnostics.Process
    Dim filename As String
    MyProcs = process.GetProcessesByName("SAP Business One")
    If MyProcs.Length = 1 Then
    For i As Integer = 0 To MyProcs.Length - 1
    '// WindowWraper concepts are used to access open dialogue box of windows
    Dim MyWindow As New WindowWrapper(MyProcs(i).MainWindowHandle)
    MyTest.Filter = "Excel files (.xls)|.xls|Document files (.doc)|.doc|Presentation (.ppt)|.ppt|Adobe PDF Files (.pdf)|.pdf|Text Documents (.txt)|.txt" '|All Files (.)|."
    'MyTest.InitialDirectory = "C:\Program Files\SAP\SAP Business One\Attachments"
    '// Initial path for open dialogue box
    '// We can change as per the requirements
    MyTest.InitialDirectory = "C:\Program Files\SAP\SAP Business One\Attachments"
    If MyTest.ShowDialog(MyWindow) = DialogResult.OK Then
                            filename = MyTest.FileName
    .your validations........
    Else
               System.Windows.Forms.Application.ExitThread()
       End If
    end sub
    Public Class WindowWrapper
    Implements System.Windows.Forms.IWin32Window
    Private _hwnd As IntPtr
    Public Sub New(ByVal handle As IntPtr)
    _hwnd = handle
    End Sub
    Public ReadOnly Property Handle() As System.IntPtr Implements System.Windows.Forms.IWin32Window.Handle
    Get
    Return _hwnd
    End Get
    End Property
    End Class
    to open the file you can use the follwing code on display button pressed.
    Private Sub fileopen(ByVal filename As String)
            '// Opening specified document with reference to the filename distributed 
            Try
                System.Diagnostics.Process.Start(filename)
            Catch ex As Exception
                sbo_application.StatusBar.SetText("File Not Found in Specified Path:" & filename, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
            End Try
        End Sub
    Regards,
    Ganesh K

  • Exel to open automaticially after expeorting from Business One

    Hi guys
    How can make excel to open up after exporting with the data. I have a few PC's which do it and a few which save it but won't opoen the file up automaticially. Where would the setting be??
    Thanks a lot

    This is usually related to user right to the file for Autoopen.Xls.  You could allocate the file under ..Program Files\SAP\SAP Business One\ExclDocs if it is local.  If it is under shared folder, the user has to got full right to the folder.
    Thanks,
    Gordon

  • One solution for Safari 3.2 crashing if you don't have any 3rd party apps

    So Safari 3.2 was crashing like crazy for me and i tried everything suggested on these forums without success. I never had any 3rd party "hacks" installed like PithHelmet that are known to cause the issue. I remembered i had a proxy server setup to access journals from my school library at home a while back. Tried disabling that and now safari 3.2 has been running without crashing for 2 days.
    Just putting it out there for those of you still having crashing issues. I'm sure it's not the cure-all, but maybe some of you still have a proxy enabled. I hope apple fixes this particular issue eventually, because i need to use the proxy.
    Message was edited by: zig_k

    I guess that is the other side of the analysis. I am similarly not really aware of the way that the proxy works -- I guess it confirms data and settings -- and with the PAC file, these are changed from time to time. I guess, if it is working in FF and not Safari, you might try a few things like turning off then on the proxy settings; creating another Location; resetting Safari (keep that one for later); trashing the relevant preference files; asking your sysadmin; and sending feedback to Apple, with the PAC file location.

Maybe you are looking for

  • Connect mac to a tv?

    I recently purchased a Mini DisplayPort to HDMI adapter to connect my Mac to my TV.  I wan to use it to play my Netflix on my TV.  I get it all plugged in and all the shows up is the star/space background.  Do I have to change a setting on the comput

  • The CSSD does not start automatically on Non-RAC - AIX 5L

    Hi all, Database: Oracle 10.2.0.4 O.S AIX 5.3 TL 10 I am facing a problem with the CSSD Non-RAC/Clusterware. When we restarted the server the service CSSD does not start automatically and there is no relevant messages in the log files of CSSD. Runnin

  • ISE upgrade to version 1.2

    My company ISE is installed into VM, we got a plan to upgrade the ISE form 1.1.1.268 to 1.2. But I read through all the documentation it required VM upgrade from 32 bits to64 bits. But I have confused with the VM portion. If my current are 32 bits VM

  • Activesync: changes on IPAD/IPhone not reflected in Exchange or viceversa

    Hello, This last few weeks we are trying to seek a solution for the next issue: If a user changes the subject-field of a received email in his Outlook inbox the changed subject is not synced to his/her IPAD or IPhone. This is the same if we perform t

  • Can't take off credit card from itunes store and 'none' is not an option

    I need help taking off my credit card from itunes and when i edit payment options 'none' is not an option what do i do?