locked
POST to web service without input variables

    Question

  • is there a way to POST xml to a web service that does not take any input parameters? 

    [webmethod]
    public string ReceiveXML()

    if so, how do I grab the xml that has been sent?  How would I determine what xml was posted?

    The reason I ask is because I have created a web service that will take in a string

    [webmethod]
    public string ReceiveXML(string _receivedStr)

    but the user that is sending the information cannot change the variable they are sending to _receivedStr.  I do not know what variable they are using.  They say they are doing a basic post and no input variable is needed.  Any suggestions?
    Tuesday, October 04, 2005 7:01 PM

Answers

  • Change the string type to XmlElement like this
    [WebMethod]
    public string ReceiveXml(XmlElement inXml) { ... }

    if the return type is also XML, change the return string to XmlElement.
    To see exactly what the sender needs to send you, use Internet Explorer to navigate to the service which will get you an HTML page listing the operations exposed by the service. Click on the ReceiveXml operation and you'll get another page that shows you example input and output messages.

    Thursday, October 13, 2005 12:56 AM