简体   繁体   English

WCF服务在调用它时未获取Java应用程序提供的参数

[英]WCF Service is not getting the parameter supplied from java application while calling it

I have a WCF service deployed at a certain server. 我在某个服务器上部署了WCF服务。

I need to call it through the JAVA application, when i am checking the parameter for this OperationContract is being passed correctly from java side but when i am logging the parameter value in WCF service, it seems not to be received here. 我需要通过JAVA应用程序调用它,当我检查该OperationContract的参数是否已从Java端正确传递时,但是当我在WCF服务中记录参数值时,似乎在这里未收到它。

We are using 'basicHttpBinding' only and the attributes set for the Service and OperationContracts are as follows :- 我们仅使用“ basicHttpBinding”,并且为Service和OperationContracts设置的属性如下:-

[ServiceContract]
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use =     OperationFormatUse.Encoded)]
public interface IMyService
{
    [WebMethod]
    [OperationContract(Action = @"http://tempuri.org/GetString")]
    [WebInvoke(Method = "GET", BodyStyle = WebMessageBodyStyle.Wrapped)]
    string GetString(string strParameters);
}

Can any body check if this is correct or may suggest with all the steps so that a WCF can be accessed properly through JAVA application ? 任何机构都可以检查这是否正确,或者可以建议所有步骤,以便可以通过JAVA应用程序正确访问WCF?

For REST ful WCF, try using WEbHTTPBinding rather basic HTTP. 对于RESTful WCF,请尝试使用WEbHTTPBinding而非基本HTTP。 REST WCF support WebHTTPBindings REST WCF支持WebHTTPBindings

WebInvoke attribute is not used for BasicHttpBinding (It is for webhttpBinding). WebInvoke属性不用于BasicHttpBinding(用于webhttpBinding)。 You can take that out. 你可以拿出来。 One way to diagnose is open config in wcf config editor (SvcConfigEditor.exe). 一种诊断方法是在wcf配置编辑器(SvcConfigEditor.exe)中打开配置。 Enable tracing (search for enabling wcf tracing), make a request to service which will generate trace file. 启用跟踪(搜索以启用wcf跟踪),请求服务将生成跟踪文件。 Check the log in Trace viewer (svtraceviewer.exe). 检查跟踪查看器(svtraceviewer.exe)中的日志。 You will find place where it is failing. 您将找到发生故障的地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM