Hi ,
I am facing some problem in consuming a function written in a WCF service (returning JSON string) from a web application code behind. (added the wcf service as service reference to this web application).
Here is my wcf service web.config
<system.serviceModel>
<services>
<service name="Tranzila.wcfVendingWeb" behaviorConfiguration="DefaultBehavior">
<endpoint name="HttpsEP" address="" behaviorConfiguration="AjaxBehavior" binding="webHttpBinding" bindingConfiguration="webBindingHTTPS" contract="Tranzila.IwcfVendingWeb">
</endpoint>
<endpoint contract="IMetadataExchange" binding="mexHttpsBinding" address="mex" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="DefaultBehavior">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="AjaxBehavior">
<!--<enableWebScript />-->
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="webBindingHTTPS">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</webHttpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
</serviceHostingEnvironment>
</system.serviceModel>
And Here comes my web.application (Client) web.config
<system.serviceModel>
<client>
<endpoint name="HttpsEP" address="https://test-tranzila.azurewebsites.net/wcfVendingWeb.svc" behaviorConfiguration="AjaxBehavior" binding="webHttpBinding" bindingConfiguration="webBindingHTTPS" contract="WCFVendingWeb.IwcfVendingWeb">
<!--<identity>
<dns value="localhost" />
</identity>-->
</endpoint>
</client>
<behaviors>
<serviceBehaviors>
<behavior name="DefaultBehavior">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="AjaxBehavior">
<enableWebScript />
<!--<webHttp/>-->
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="webBindingHTTPS">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</webHttpBinding>
</bindings>
</system.serviceModel>
I am consuming the service from the code behind as
Dim obj As WCFVendingWeb.IwcfVendingWebClient = New WCFVendingWeb.IwcfVendingWebClient("HttpsEP")
Dim test = obj.SendTransaction("1234432112344321", "12", "2013", "2", "t", "tt", "cmpny")
The service returns the result as json string as below
Dim oSerializer As New JavaScriptSerializer
Dim jsonResultString = oSerializer.Serialize(clsResponse)
Return jsonResultString
but the problem i am facing is when i try to call the SendTransaction funtion it is always displaying me the error as..
I am unable to fix it and struggling. please anyone can give me solution..
Thanks in advance.