SoapUI wsdl wcf net.tcp missing importer - wcf

Nn generall I have serving hosting on tcp and I can't parse my wsdl with SoapUI, while it works with wcfTestClient.
SoapUI gives me error:
Missing importer for...
Missing portType for binding..
Unfortunally I need to add headers which I heard is immposible for wcfTestClient.
And my service configuration
<service name=".." behaviorConfiguration="...">
<endpoint binding="netTcpBinding" bindingNamespace="http://.." bindingConfiguration="SecureNetTcpBinding" contract="..." address="" />
<endpoint address="mex" bindingNamespace="http://.." binding="netTcpBinding" bindingConfiguration="SecureNetTcpBindingMex" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:50002...svc" />
</baseAddresses>
</host>
</service>
<binding name="SecureNetTcpBindingMex" maxConnections="400" listenBacklog="400">
<security mode="None">
</security>
</binding>
Is it possible to parse wcf net.tcp with SoapUI ? If not what options do I have ?

Just add the following endpoint:
<endpoint address="soap" binding="basicHttpBinding" contract="...">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
Then consume into SoapUI from http://localhost:50002...svc/soap

Related

WCF Endpoint address without port number

I have a WCF service without port numbers in the endpoint address. I want to know how the ports are assigned?
Service Endpoint
<services>
<service behaviorConfiguration="CalServiceBehavior" name="Test.Services.CI.Cal1Service">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="NetTcpBinding" name="Cal1Service" contract="Test.Services.Cal1.ICal1Service" />
</service>
<service behaviorConfiguration="CalServiceBehavior" name="Test.Services.CI.Cal2Service">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="NetTcpBinding" name="Cal2Service" contract="Test.Services.Cal2.ICal2Service" />
</service>
</services>
Client Endpoint
<client>
<endpoint name="cal1" address="net.tcp://100.100.11.4/Test.Services.Cal1/Cal1Service.svc" binding="netTcpBinding" bindingConfiguration="NetTcpBinding" contract="Test.Services.Cal1.ICal1Service"/>
<endpoint name="cal2" address="net.tcp://100.100.11.4/Test.Services.Cal2/Cal2Service.svc" binding="netTcpBinding" bindingConfiguration="NetTcpBinding" contract="Test.Services.Cal2.ICal2Service"/>
</client>

NetNamedPipeBinding create an issue when service is restarted

We are using WCF service with NetNamedPipeBinding binding. It works without any problem.But some time when we replace service's bin in IIS or restart the service then client can not connect with service. During this error If we change the binding from NetNamedPipeBinding to BasicHttpBinding in client side then work perfectly.
Client does not receive the response from the service. So how we can overcome from this issue and just want to know what is the actual issue with NetNamedPipeBinding?
if there is an any better replacement of NetNamedPipeBinding.
Update:
Service side configuration
<services>
<service behaviorConfiguration="ServicesBehavior" name="WcfServices.Service1">
<endpoint address="soap" behaviorConfiguration="FlattenWsdlEndpointBehavior" binding="basicHttpBinding" contract="WcfServices.IService1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="json" behaviorConfiguration="webHttpBehavior" binding="webHttpBinding" contract="WcfServices.IService1" />
<endpoint address="NamedPipe" binding="netNamedPipeBinding" contract="WcfServices.IService1" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
Client side configuration
<client>
<endpoint address="http://someAddress/WcfServices/Service1.svc/soap" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1" contract="WcfServices.IService1" name="BasicHttpBinding_IService1" />
<endpoint address="net.pipe://localhost/WcfServices/Service1.svc/NamedPipe" binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_IService1" contract="WcfServices.IService1" name="NetNamedPipeBinding_IService1" />
</client>
Thanks in advance.
If someone can help me on this.

What are the reasons that cause ServiceActivationException?

I have a service which is hosted in Azure environment. i am consuming that service using a console application. While doing so, i get exception:
"The requested service,
'http://xxxx-d.yyyy.be/Services/zzzzInService.svc' could not be
activated. See the server's diagnostic trace logs for more
information."
Can anyone help me to find what i am missing ?
The service is defined like this -
<service name="xxxx.AppServer.Host.Services.yyyyy.zzzzPlugInService"
behaviorConfiguration="MetadataBehavior" xdt:Locator="XPath(//service[#name='xxxx.AppServer.Host.Services.yyyy.zzzzPlugInService'])" xdt:Transform="Replace">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding" contract="xxxx.Shared.IntegrationServices.yyyy.IzzzzPlugInService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpsBinding" contract="xxxx.Shared.IntegrationServices.yyyy.IzzzzPlugInService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
When i Use the link http://xxxx-d.yyyy.be/Services/zzzzInService.svc in browser i get these messsage -
The binding at system.serviceModel/bindings/basicHttpBinding does not
have a configured binding named 'basicHttpBinding'. This is an invalid
value for bindingConfiguration.
source :
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding" contract="xxxx.Shared.IntegrationServices.zzzzz.IzzzzPlugInService">
The error says that you don't have a binding configuration for "basicHttpBinding" named "basicHttpBinding". Since you didn't post your complete config, and the error message says that, I'll assume that this is the case.
The config below (under <system.serviceModel>) has two binding definitions under <basicHttpBinding>, one for each binding configuration you have in your endpoint declarations. You should have something similar in your config as well.
<services>
<service name="xxxx.AppServer.Host.Services.yyyyy.zzzzPlugInService"
behaviorConfiguration="MetadataBehavior"
xdt:Locator="XPath(//service[#name='xxxx.AppServer.Host.Services.yyyy.zzzzPlugInService'])"
xdt:Transform="Replace">
<endpoint address=""
binding="basicHttpBinding"
bindingConfiguration="basicHttpBinding"
contract="xxxx.Shared.IntegrationServices.yyyy.IzzzzPlugInService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address=""
binding="basicHttpBinding"
bindingConfiguration="basicHttpsBinding"
contract="xxxx.Shared.IntegrationServices.yyyy.IzzzzPlugInService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding" />
<binding name="basicHttpsBinding">
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
One of the other reasons can be if you have a duplicate or overload methods in your svc.cs file

WCF bindingConfiguration Issue

I'm getting the maxStringCount is exceeded error, and have read a ton on fixing the issue (that is, if you're using http bindings).
Problem for me, I'm using netTcpBinding. So I have no idea what to put in bindingConfiguration.. Here's my app.config:
<services>
<service behaviorConfiguration="ExStreamWCF.Service1Behavior"
name="ExStreamWCF.Service1">
<endpoint address="" binding="netTcpBinding" bindingConfiguration=""
contract="ExStreamWCF.IService1">
<identity>
<dns value="Devexstream-2.anchorgeneral.local" />
<!--<dns value="vmwin2k3sta-tn2" />-->
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://Devexstream-2:8080/Service" />
<!--<add baseAddress="net.tcp://vmwin2k3sta-tn2:8080/Service" />-->
</baseAddresses>
</host>
</service>
Any ideas?
Thanks,
Jason
Do you mean maxStringContentLength? If so, you set that in the same section of the config file you do for other bindings - in the ReaderQuotas section of the Binding section. I.e.:
<Bindings>
<netTcpBinding>
<binding name=".....>
<readerQuotas maxStringContentLength="8192" .... />
</binding>
</netTcpBinding>
</Bindings>
If you mean something else, can you provide some more details?

How to configure basicHttpBinding for WCF service

I have a WCF service that I'm trying to get to work with wcf, old soap and plain xml. The service is called TestService.svc and the configuration looks like this:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="TestServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="poxBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="TestServiceBehavior" name="TestService">
<endpoint address="" binding="wsHttpBinding" contract="ITestService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
<endpoint address="soap" binding="basicHttpBinding" contract="ITestService"/>
<endpoint address="xml" binding="webHttpBinding" behaviorConfiguration="poxBehavior" contract="ITestService"/>
</service>
</services>
</system.serviceModel>
I got this code from this other question:
REST / SOAP endpoints for a WCF service
Now, the XML webHttpBinding seems to work well, but the wsHttpBinding and basicHttpBinding does not work very well.
I can browser to the service using:
http://localhost:8295/WCFTest/TestService.svc
I can also use that endpoint to add a service reference in an asp.net web site project and attempt to consume the service, but when I create the client:
TestService.TestServiceClient mytest = new TestService.TestServiceClient();
It says to specify an endpoint due to multiple endpoints. I guess due to having both wsHttp and basicHttp? How do I specify the endpoint here?
Next I try to consume the basicHttpBinding endpoint by adding a Web Reference (not service reference) to a .net 2.0 web site. At this point I'm not able to add the reference and receive an error 400.
So next I remove the wsHttp binding and am able to add the web reference and consume the service via a .net 2.0 client.
How do I configure it so that I can use wsHttpBinding for clients that can consume normal WCF services, basicHttpBinding for clients that can only consume older non-WCF SOAP requests and still have webHttpBinding available for clients that want to consume plain xml?
The person who posted this link (http://www.codemeit.com/wcf/wcf-restful-pox-json-and-soap-coexist.html) appears to be correct. But since this question remains unanswered, I'll elaborate a bit.
If you haven't tried it, I will mention first that nowhere in your configuration do you specify an actual address for the client service to connect to.
<service behaviorConfiguration="TestServiceBehavior" name="TestService">
<endpoint address="" binding="wsHttpBinding" contract="ITestService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
<endpoint address="soap" binding="basicHttpBinding" contract="ITestService"/>
<endpoint address="xml" binding="webHttpBinding" behaviorConfiguration="poxBehavior" contract="ITestService"/>
</service>
Your first endpoint has
<endpoint address="" binding="wsHttpBinding" contract="ITestService">
Based on documentation on MSDN (found here) and the link above, it appears that you are missing this in your service configuration
<host>
<baseAddresses>
<!-- note, choose an available port-->
<add baseAddress="http://localhost:8295/WCFTest/TestService" />
</baseAddresses>
</host>
Adding that would make your service configuration look like this
<service behaviorConfiguration="TestServiceBehavior" name="TestService">
<host>
<baseAddresses>
<!-- note, choose an available port-->
<add baseAddress="http://localhost:81/TestService" />
</baseAddresses>
</host>
<endpoint address="" binding="wsHttpBinding" contract="ITestService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
<endpoint address="soap" binding="basicHttpBinding" contract="ITestService"/>
<endpoint address="xml" binding="webHttpBinding" behaviorConfiguration="poxBehavior" contract="ITestService"/>
</service>
Adding that section will provide the address to use, while the specific endpoints will then use addresses relative to the base address provided.