安価なwcfサービスへの標準Get Request呼び出しを作成すると、content typeが "application/xml"で返されます。ベンダーは、コンテンツタイプ「text/xml」で送信するよう求めています。これをwcfでどのように切り替えるのですか?それは属性ですか? text/xml restからの戻り呼び出し
コール
はこれです:[ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, Namespace = "")]
[XmlSerializerFormat(Style = OperationFormatStyle.Document, Use=OperationFormatUse.Literal)]
public class Player
{
[WebGet(UriTemplate = "{id}")]
public string GetTestDetailsRequest(string id)
{
TestService.TestServiceClient testServiceClient = new TestServiceClient();
string xml = testServiceClient.GetTestDetailsRequest(Guid.Parse(id));
return xml;
}
}
のHttpClient WCF休憩スターターキットプレビューに含まれている2 http://aspnet.codeplex.com/releases/view/24644 –
@JoeyのHTTPClientをサポートされなくなりました。 http://wcf.codeplex.com –
に感謝の気持ちがあります。 WCFのRESTスタックが変化し続けるように思える... Glenがそれを引き継いだのを忘れてしまった。 –