我知道这已被多次询问,并且多次回答,但是,所有提供的应该使用的样本似乎并不想今天为我工作.
当我尝试启动主机时,我不断收到以下错误:
"在服务TraceService实现的合同列表中找不到合同名称'IMetadataExchange'.将ServiceMetadataBehavior直接添加到配置文件或ServiceHost以支持此合同."
根据Microsoft的示例,我的服务托管在托管的Windows服务主机中:http://msdn.microsoft.com/en-us/library/ms733069%28v=vs.90%29.aspx
这是我的简单配置:
<system.serviceModel>
<services>
<service name="Daff.Lae.Service.TraceService">
<endpoint address="" binding="wsHttpBinding" name="TraceService" contract="Contracts.Service.ITraceService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080/TraceService" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="DefaultBehavior">
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
Run Code Online (Sandbox Code Playgroud)
当然,如果删除此行,则没有错误时问题会变得更有趣:
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
Run Code Online (Sandbox Code Playgroud)
任何帮助将非常非常感谢:)
在JAVA SDK中,可以设置端点,请参见此处.
但是如何为.NET SDK做到这一点?有什么名字可以使用?
因为似乎总是使用默认端点"US East(Northern Virginia)Region".
我正在创建一个简单的SOAP Web服务.我要确保它在tomcat Web服务上运行.
我试图用JAX-WS实现这个(参见代码)
我的问题是:Endpoint.publish是否使用tomcat服务器来托管这个或者它是一种迷你玻璃鱼类服务器?
我应该扩展UnicastRemoveObject或类似的东西吗?
理想情况下,它可以打包成.WAR并放入目录中然后才能工作.
它似乎不适用于我安装的tomcat服务器,因为它说端口已经在使用中.我正在使用安装了tomcat6包的Ubuntu karmic,它也可能是我的用户没有权限发布到8080上运行的tomcat
我希望这个问题足够清楚
示例代码:
@WebService
public class UserAttributes {
public static void main(String[] args) {
UserAttributes instance = new UserAttributes();
Endpoint.publish("http://localhost:8082/WebServices/userattributes",
instance);
}
public string Hello() {
return "Hello World";
}
}
Run Code Online (Sandbox Code Playgroud) 当我转到我的herokussl.com URL(添加证书和Heroku SSL端点之后)时,我可能会收到"No Such App"错误的任何想法?
我按照这里的说明(https://devcenter.heroku.com/articles/ssl-endpoint),获得了一个herokussl.com网址.
我真的不认为这是一个DNS问题 - 因为我还没有采取这一步骤.
我无法清楚地理解服务端点和专用端点之间的区别。
需要帮助,最好有一个例子。
azure endpoint paas azure-virtual-network azure-private-link
我正在尝试从另一个服务中调用WCF服务,部分使用我在StackOverflow上找到的实现ChannelFactory的示例.
我在我的测试解决方案中创建了一个单独的控制台应用项目(VS 2008,btw),
namespace MyService.Test
{
class Program
{
static void Main(string[] args)
{
MySolution.MyTestClient proxy = new MyTestClient();
proxy = new MyTestClient();
proxy.Endpoint.Address = new EndpointAddress("http://localhost:8723/MySolution/");
// Instantiate a request object and assign values to its member variables.
MySolution.RemoteServiceMethod() theObject = new RemoteServiceMethod();
theObject.SomeProperty = "123";
theObject.SomeOtherProperty = "alpha";
Console.WriteLine("Calling the remote service method now...");
try
{
proxy.SubmitRemoteServiceRequest(proxy.theObject);
}
catch (FaultException<MySolution.RequestException> e)
{
// exception code hereMySolution
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是来自本地服务的App.Config,显示端点:
<system.serviceModel>
<client>
<endpoint …
Run Code Online (Sandbox Code Playgroud) tag_media_recent将max_id和min_id作为参数.
文档说明:
MIN_ID 在此min_id之前返回媒体.
MAX_ID 在此max_id之后返回媒体.
我试过max_id = 3390883111979
(非常大于目前使用的)
它返回最新的标记图像.它不遵循min_id的定义吗?似乎很无聊
我也试过min_id = 1390922265529
和max_id = 1390922265528
.它返回12张图像.当给定的最大范围是3时,这怎么可能?
我也试图扭转使用的值min_id
和max_id
.还有16张图片.....
无法从min_tag_id和max_tag_id得到任何东西......
有人得到了答案吗?
使用ServiceHost.AddServiceEndpoint添加自定义ProtoEndpointBehavior时,我收到以下异常:
System.ArgumentNullException:值不能为null.参数名称:System.Collections.Generic.Dictionary上的键
2.FindEntry(TKey key) at System.Collections.Generic.Dictionary
2.ContainsKey(TKey键)位于System.ServiceModel.ServiceHostBase.ImplementedContractsContractResolver.ResolveContract(String contractName),位于System的System.ServiceModel.ServiceHostBase.ServiceAndBehaviorsContractResolver.ResolveContract(String contractName).位于My.Service.Business的System.ServiceModel.ServiceHostBase.AddServiceEndpoint(ServiceEndpoint端点)的System.ServiceModel.Description.ConfigLoader.LookupContract(String contractName,String serviceName)中的ServiceModel.Description.ConfigLoader.LookupContractForStandardEndpoint(String contractName,String serviceName). C:\ My\Produkter\My Utveckling\Solution\My.Service.Business\ServiceHandler.cs中的ServiceHandler.StartService(类型serviceType,String uri,SecureConnectionSettings secureConnectionSettings):第150行
这是代码的样子:
ServiceHost serviceHost = null;
Console.WriteLine("Creating service " + serviceType.FullName);
serviceHost = new MyServiceHost(serviceType, new Uri(uri));
var endPointAddress = "";
HttpBindingBase binding = null;
if (secureConnectionSettings != null && secureConnectionSettings.Enabled)
{
Console.WriteLine("Setting certificates");
X509Store store = new X509Store(secureConnectionSettings.CertificateStore, secureConnectionSettings.CertificateLocation);
store.Open(OpenFlags.ReadOnly);
X509Certificate2Collection certs = store.Certificates.Find(X509FindType.FindByThumbprint, secureConnectionSettings.Thumbprint, true);
store.Close();
if (certs.Count > 0)
serviceHost.Credentials.ServiceCertificate.SetCertificate(secureConnectionSettings.CertificateLocation,
secureConnectionSettings.CertificateStore,
X509FindType.FindByThumbprint,
secureConnectionSettings.Thumbprint);
else
throw new Exception("Could not finde certificate …
Run Code Online (Sandbox Code Playgroud) 我正在尝试为具有5个接口的USB HUB设备设置备用设置.以下是每个接口的配置.
1. Ifs= 5 Cfg#= 1 Atr=c0 MxPwr= 2mA A: FirstIf#= 0 IfCount= 1
Cls=08(stor.) Sub=06 Prot=50 A: FirstIf#= 1 IfCount= 1 Cls=03(HID
) Sub=00 Prot=00 A: FirstIf#= 2 IfCount= 2 Cls=01(audio) Sub=00
Prot=00 A: FirstIf#= 4 IfCount= 1 Cls=fe(app. ) Sub=01 Prot=01
2. I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50
Driver=usb-storage E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E:
Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
3. I:* If#= 1 Alt= 0 #EPs= 2 Cls=03(HID ) Sub=00 Prot=00 …
Run Code Online (Sandbox Code Playgroud) Instagram用于在端点下将开放数据公开为json https://www.instagram.com/<username>/?__a=1
.这改变了一夜,端点不再可用.什么是新的端点或什么可以替代它?
提前致谢!