DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    Bill C Guest

    send xml file to web service


    i want to send an xml file to a web service. the web service will accept the
    xml file, process it and perhaps return some info.

    how do i set up the web service and the client so that i can send the xml
    file from client to web service?

    currently it looks like this

    [WebMethod]
    public void GetScanFile(XmlDocument sf)
    {
    XmlTextWriter myXmlTextWriter = new XmlTextWriter ("c:\\WCCS-CS\\"+sf, null);
    myXmlTextWriter.Close();
    }

    and i call it like this
    WebRef.MyService a=new WebRef.MyService

    XmlDocument x=new XmlDocument();

    x.LoadDoc("C:\\test.xml");
    a.GetScanFile(x);

    ALL OF THE SYNTAX AND connections to the web serice work fine
    when i hit the last line i get a System.xml system error, so obviously sending
    an xml like this doesnt work. what will?

  2. #2
    Marian Olteanu Guest

    Re: send xml file to web service


    Why don't you send a serialized version of the XML, in a string?
    Anyway, I see that all you want to do is to put a file on the server, so
    it does not matter so much if it is XML or not.


    "Bill C" <bcrider@uasi-qc.com> wrote:
    >
    >i want to send an xml file to a web service. the web service will accept

    the
    >xml file, process it and perhaps return some info.
    >
    >how do i set up the web service and the client so that i can send the xml
    >file from client to web service?
    >
    >currently it looks like this
    >
    >[WebMethod]
    >public void GetScanFile(XmlDocument sf)
    >{
    >XmlTextWriter myXmlTextWriter = new XmlTextWriter ("c:\\WCCS-CS\\"+sf, null);
    >myXmlTextWriter.Close();
    >}
    >
    >and i call it like this
    >WebRef.MyService a=new WebRef.MyService
    >
    >XmlDocument x=new XmlDocument();
    >
    >x.LoadDoc("C:\\test.xml");
    >a.GetScanFile(x);
    >
    >ALL OF THE SYNTAX AND connections to the web serice work fine
    >when i hit the last line i get a System.xml system error, so obviously sending
    >an xml like this doesnt work. what will?



  3. #3
    Join Date
    Jun 2012
    Posts
    1
    Send file (xml or binary) by web service : http://www.biclim.com/WSClients.action

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links