0

SOAP UI からのメッセージの下に投稿していますが、Web サービスで常に null 値を受け取ります。SOAP UI から投稿しているメッセージは、null のみと見なされます。

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body>
Test
</env:Body>
</env:Envelope>

以下は私の単純なWebServiceです

[WebService(Namespace = "http://test.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
public class TestService : System.Web.Services.WebService {

    [WebMethod]
    public int TestMethod(string message)
    {
        try
        {
            File.WriteAllText("D:\\abc.xml", message);
            return 0;
        }
        catch (Exception ex)
        {
            return 1;
        }
    }
}
4

1 に答える 1

0

You're not specifying which method to call or the parameters of that method in your body. You'll need something like this:

<env:Body>
  <m:TestMethod xmlns:m="http://tempuri.org">
    <message>Test</message>
  </m:TestMethod>
</env:Body>
于 2012-12-14T18:17:37.183 に答える