我有一个创建web服务的应用程序,通常我发送一个xml并且应用程序执行: 我发送这样的东西:
<?xml version="1.0" encoding="utf-8"?>
<PostRequest>
<SetValue Name="Timeline.RestartScene" Type="Trigger" Value="false" />
</PostRequest>
成功时的回应是:
System.Net.HttpWebResponse<?xml version="1.0" encoding="utf-8"?>
<PostReply Success="1" Status="OK">
<SetValue Name="Timeline.RestartScene" Success="1" Status="OK"/>
</PostReply>
我的问题是我是否可以发现除SetValue之外的其他命令。 我试过但反应总是:
System.Net.HttpWebResponse<?xml version="1.0" encoding="utf-8"?>
<PostReply Success="0" Status="Syntax error">
</PostReply>
我尝试使用WSDL但响应是:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>wsdl /protocol:HttpPost h
ttp://localhost:5521/postbox
Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 4.0.30319.1]
Copyright (C) Microsoft Corporation. All rights reserved.
Error: There was an error processing 'http://localhost:5521/postbox'.
- There was an error downloading 'http://localhost:5521/postbox'.
- The request failed with HTTP status 403: Forbidden.
If you would like more help, please type "wsdl /?".
我也尝试用svcutil来获取一些信息:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>svcutil http://localhost:
5521/postbox
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.1]
Copyright (c) Microsoft Corporation. All rights reserved.
Attempting to download metadata from 'http://localhost:5521/postbox' using WS-Me
tadata Exchange or DISCO.
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.1]
Copyright (c) Microsoft Corporation. All rights reserved.
Error: Cannot obtain Metadata from http://localhost:5521/postbox
If this is a Windows (R) Communication Foundation service to which you have acce
ss, please check that you have enabled metadata publishing at the specified addr
ess. For help enabling metadata publishing, please refer to the MSDN documentat
ion at http://go.microsoft.com/fwlink/?LinkId=65455.
WS-Metadata Exchange Error
URI: http://localhost:5521/postbox
Metadata contains a reference that cannot be resolved: 'http://localhost:552
1/postbox'.
The content type text/xml; charset=utf-8 of the response message does not ma
tch the content type of the binding (application/soap+xml; charset=utf-8). If us
ing a custom encoder, be sure that the IsContentTypeSupported method is implemen
ted properly. The first 109 bytes of the response were: '<?xml version="1.0" enc
oding="utf-8"?>
<PostReply Success="0" Status="Invalid content type">
</PostReply>
'.
HTTP GET Error
URI: http://localhost:5521/postbox
There was an error downloading 'http://localhost:5521/postbox'.
The request failed with HTTP status 403: Forbidden.
If you would like more help, type "svcutil /?"