开发者

Proxy web Service .net

i am writing a proxy web service which accepts the xml and sends it to another http service. problem is when i read the xml it always comes as null.

here is my code

      [WebMethod]
        public string HelloWorld(string xml)
        {

             xml= @"<env> <body>" + xml + @"</body> </env>";           
            return HttpPost("hhtp://testservice/", xml) ;
        }

here is my request xml

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
   <soapenv:Header/>
   <soapenv:Body>
      <HelloWorld>
         <!--Optional:-->
         <xml>
            <request1>
            <value1 test="a"/>
        </request1>
</xml>
      </HelloWorld>
   </soapenv:Body>
</soapenv:Envelope&开发者_StackOverflow社区gt;

if i use the Visual studio debugger and give the xml below i can see the values comming in, but using soapui to send the xml above i had i get Null as xml.

            <request1>
            <value1 test="a"/>
        </request1>

UPDATE I used XMDocument instead of using string


Use the XmlTextReader object to read the disk file into the XmlDocument object.

You can find a code sample from the following code project url,

http://www.codeproject.com/KB/XML/csreadxml1.aspx

Hope this helps you...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜