我正在编写一个web服务,假设将json两个json字符串保存到DB.我可以使用sope UI和WCF Test Client调用它,但我无法通过浏览器调用它.有办法做到这一点吗?
该服务最初将由Android应用程序使用,我已经尝试从它运行,没有任何运气.
提前致谢.
这是我服务的界面
[ServiceContract]
public interface IRService
{
[OperationContract]
[WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "SaveCallResults?callInfo={callInfo}&testInfo={testInfo}")]
string SaveCallResults(string callInfo, string testInfo);
}
Run Code Online (Sandbox Code Playgroud)
这是我的web.config
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_RService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxBufferSize="65536" maxReceivedMessageSize="65536"
textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"
messageEncoding="Text">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" /> …Run Code Online (Sandbox Code Playgroud) 我正在 Umbraco 中使用 Archtype 构建图像滑块。
我开始使用 umbraco 7.5.9 和 Umbraco.MediaPicker 时,但同时我开始了一个使用 Umbraco.MediaPicker2 的最新版本 Umbraco (7.6.2) 的新项目
使用旧的 MediaPicker 渲染图像没有问题,但使用 MediaPicker2 似乎不可能。
这是我的设置。
<div class="fullWidthSlider">
@foreach (var image in @CurrentPage.SliderImages)
{
<div>Id: @image.GetValue("image")</div>@*Line added for debug*@
var media = @Umbraco.Media(image.GetValue("image"));
<img src="@media.Url" />
}
</div>
Run Code Online (Sandbox Code Playgroud)
这曾经适用于旧的媒体选择器,@image.GetValue 返回 int id。但是使用新的 MediaPicker2 它返回 Umbraco.Core.Udi[]
如果我使用下面的代码遍历 archtype 的属性,我会得到这个结果(见下面的代码)
@foreach (var fieldset in Model.Content.GetPropertyValue<ArchetypeModel>("sliderImages"))
{
foreach(var prop in fieldset.Properties){
<p>@prop.Alias - @prop.Value</p>
}
}
Run Code Online (Sandbox Code Playgroud)
href -
altText - alt 测试
图像 …