XML formatting issue...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • santoshsri
    New Member
    • Jan 2007
    • 48

    XML formatting issue...

    Hi,

    I am new to .Net. Actually I need to pass an XML string to a webservice.Belo w is the way how I assign the XML to a variable strXmlReportReq uest1.

    strXmlReportReq uest1 = "<PARAMETERS><R eportPath>\\\\% COMPUTERNAME%\\ ezsb\\PMS\\</ReportPath><Rep ortName>ZZPMS</ReportName><For ceReport>True</ForceReport><Da taConnectionStr ing>DSN=COSPROD </DataConnectionS tring><ReturnTy pe>5</ReturnType><Dis playFormat>5</DisplayFormat>< PolicyNumber>LP R 0000771 04</PolicyNumber><C rystalReportNam e>rptMainInForc e.rpt</CrystalReportNa me><CrystalConn ection>PADBS000 1</CrystalConnecti on><UserID>FERp tUser</UserID><Passwor d>user</Password><DataB aseName>db_FSFE LIP</DataBaseName><R EPORTPARAMETERS ><EndDate>09/13/2008</EndDate><Policy Numbers>LPR 0000771 04</PolicyNumbers>< UserName>jkwood en</UserName><Locat ionTypes>01,02</LocationTypes>< LocationTypeNam es>FP,REO</LocationTypeNam es></REPORTPARAMETER S></PARAMETERS>";

    Problem is when I am trying to get the string through response.write just after assignment . I am getting a weired string, I am getting all the node names lost !! -

    \\%COMPUTERNAME %\ezsb\PMS\ZZPM STrueDSN=COSPRO D55LPR 0000771 04rptMainInForc e.rptPADBS0001F ERptUseruserdb_ FSFELIP09/13/2008LPR 0000771 04jkwooden01,02 FP,REO


    So can any one help me , how can I retain the xml node names along with data.
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    If you have a look at web services, it transfers data as SOAP, which is XML.
    unfortunately it puts all the contents of the string within the string type element and sends it,
    at the receiving end, it takes all the text in the node of the element the web service is expecting
    and hence you loose all the xml information
    the way to solve it is to convert the xml format as a class and pass it through, which means that your data will be easier to process and will be strongly type (less prone to errors)

    Comment

    • santoshsri
      New Member
      • Jan 2007
      • 48

      #3
      Thanks for the reply. But the webservice is expecting the input to be in string format . Can I send the class yet ? A code snippet will help me to better understand


      Again, Thanks !!

      Comment

      • santoshsri
        New Member
        • Jan 2007
        • 48

        #4
        Let me come to the point.. Actually above string is being sent to a webservice. The webservice in response returns another XML which our code interprets and converts to PDF.

        This code had been working fine since last 3 years.. we have been facing this problem since last one week.. I tried to catch the exception . I got "Non-negative number required. Parameter Name: Byet count ..... "

        Seems like webservice response is changed than earlier.

        Any idea on this ?

        Comment

        Working...