Well, i can't solve the following problem.
I have the next:
* A Web Service development in C# + .Net Framework 3.5 + iBatis (VS2010) with some WebMethods.
* The Web Service run on a local server, in IIS 5.1 (http://localhost/BookService/BookService.asmx).
* An application WF+C# + .Net Framework 3.5 (VS2010) where the BO layer have a service reference to the Web Service.
The app.config generated by Service Reference is:
<?xml version="1.0" encoding="utf-8" ?>ยด
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BookServiceSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288"
maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<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>
<client>
<endpoint address="http://10.0.2.15/BookService/BooksService.asmx"
binding="basicHttpBinding" bindingConfiguration="BookServiceSoap"
contract="BookService.BookServiceSoap" name="BookServiceSoap" />
</client>
</system.serviceModel>
</configuration>
I'm trying to connecting me to the web service making for example
BookService.BookServiceSoapClient query = new BookService.BookServiceSoapClient("BookServiceSoap","http://10.0.2.15/BookService/BookService.asmx");
or with out the endpointname and the url
BookService.BookServiceSoapClient query = new BookService.BookServiceSoapClient();
But in execution time appears the following message
Could not find endpoint element with name 'BookServiceSoap'
and contract 'BookService.BookServiceSoap' in the ServiceModel
client configuration section. This might be because no
configuration file was found for your application, or because
no endpoint element matching this name could be found in the client element.
Can somebody show me un right example to call for example the method HelloWorld.
Regards!
Related
My client application is calling a web service, everything works fine, except a function call always throw this error (The maximum message size quota for incoming messages (33554431) has been exceeded.)
I have tried to increase the maxBufferSize in the app.config file of my client application to 335544310, but it did not help solving this problem.
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="basicHttpsEndpoint" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard" maxBufferSize="33554431" maxBufferPoolSize="33554431" maxReceivedMessageSize="33554431" messageEncoding="Text" textEncoding="utf-8"
transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="33554431" maxArrayLength="33554431" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://api.smartmailpro.com/2.0/API.svc" binding="basicHttpBinding" bindingConfiguration="basicHttpsEndpoint" contract="SmartMailProApi.API" name="basicHttpsEndpoint" />
</client>
</system.serviceModel>
I suspect that there are two possibilities
1) The value that I am using is too large
2) I need to perform the same update to the server web services as well
Could anyone point me to the right direction, please?
What are the real purposes of following three parameters :
maxBufferSize="33554431"
maxBufferPoolSize="33554431"
maxReceivedMessageSize="33554431"
Enlarge the value of the maxBufferSize to 2147483647, and solved the problem.
I am new for the WCF, i have web application which uses WCF Service as a data access layer. I am using wcf service library and hosterd it on IIS7. It works fine for few initial service calls but hangs an application for further request. When i reset IIS , then again it is working fine for some time.
Below is the service configuration in web.config of web app
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IRoaster" closeTimeout="00:10:00"
openTimeout="00:01:00" receiveTimeout="00:02:00" sendTimeout="00:03:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="199999488" messageEncoding="Text"
textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://asdf.com/RoasterService/RoasterService.Roaster.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IRoaster"
contract="RoasterService.IRoaster" name="WSHttpBinding_IRoaster">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
Is there if i comment all the wcf call then for dummy values application works fine. please suggest the appropriate solution
You're probably not disposing the WCF client instance at the end of the request. Look at this post for the gotcha's in working with WCF clients.
I have developed one console application and from there i have called WCF function after adding as web reference. my console application's web.config as per below..
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IApicaAzureMonitorAgentReceiverWCF"
closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00"
sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://apicaWCF.cloudapp.net/ApicaAzureMonitorAgentReceiverWCF.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IApicaAzureMonitorAgentReceiverWCF"
contract="Dashboard2WCFData.IApicaAzureMonitorAgentReceiverWCF"
name="BasicHttpBinding_IApicaAzureMonitorAgentReceiverWCF" />
</client>
I am getting error : The size necessary to buffer the XML content exceeded the buffer quota. I have also tried it and increased maxbuffersize and etc. still could not resolved this. hope anyone can here help me to sort out this issue.
Thanks.
Arun
Finally i got solution , the problem was with stored procedure parameter data type and got this solution using attaching process mechanism in visual studio, so i have debug the wcf function from console application and got exact error in WCF catch block.
I am deploying a web application to a remote server. I set up IIS 7 and the site comes up.
As part of the web application there is a service reference to a wcf service.
All of this works fine on my localhost everything runs.
I never did anything with the service itself on the deployment server. I just set up the web application in IIS. Now I am getting an socket exception error that could be from a few thing, I just want to eliminate my options......
My question is do I have to publish the service as part of my deployment process or since I published the web application with a service reference attached to it I should be ok?
Here is my web config portion of the service as you can see there is a reference to localhost (this cant be good) how is this resolved?
</system.webServer>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IHSSWcfServices" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<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>
<client>
<endpoint address="http://localhost:49506/IHSSWcfServices.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IHSSWcfServices"
contract="ServiceReference1.IHSSWcfServices" name="BasicHttpBinding_IHSSWcfServices" />
</client>
</system.serviceModel>
You do not have to publish the service as part of the deployment process for the application(otherwise, an ASP.NET application could never talk to an externally published service).
Just make sure that the service address you are trying to communicate with is the actual address of the hosted service (and not localhost, for instance, which would work on your machine, but not once it is deployed).
If you are writing the service and the client, the service does have to be deployed somewhere, and that somewhere must be accessible to the deployed location of the client. The deployment of the service is, however, independent of the deployment of the client.
Your system.ServiceModel section in config is clearly referencing the localhost. Try to change it to point to the actual IIS URL
I haven't deployed behind a load balancer before. My customer has a WCF service built and tested on servers using a service model configuration that is relatively straightforward. It provides a service to return an image of a map for another application. To get the map, it calls other services.
The service was built in Visual Studio 2010 targeting the 3.5 framework. The customer is using IIS 7.5 and an F5 load balancer. When moving to the production server, the Web.config was changed to add the load balancer behavior and specify the endpoint to show the physical and logical address of the service:
<services>
<service behaviorConfiguration="Service.Service1Behavior" name="StaticMapImageService.Data.MapImageService">
<endpoint
address="https://gis.customer.com/StaticMapImage/Service/StaticMapImageService.svc"
binding="basicHttpBinding"
bindingNamespace="http://customer.com"
contract="StaticMapImageService.Data.IMapImageService"
listenUri="http://hq-gis01.customer.net/StaticMapImage/Service/StaticMapImageService.svc"
behaviorConfiguration="SSLLoadBalancerBehavior">
</endpoint>
<endpoint
address="mex"
binding="mexHttpBinding"
bindingNamespace="http://werner.com"
contract="IMetadataExchange"/>
</service>
</services>
There is no entry for this service in the system.servicemodel/bindings section. The other services are configured in the bindings and client sections:
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IAddressVerificationService"
closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00"
sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard" maxBufferSize="999999999"
maxBufferPoolSize="524288" maxReceivedMessageSize="999999999"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="999999999" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
<binding name="BasicHttpBinding_IGeocoderService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="999999999" maxBufferPoolSize="524288" maxReceivedMessageSize="999999999"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="999999999" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
<binding name="PCMilerSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="999999999" maxBufferPoolSize="524288" maxReceivedMessageSize="999999999"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="999999999" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<wsHttpBinding>
<binding name="WSHttpBinding_IGeocoderService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="999999999"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://gis.customer.com/AddressVerification/Service/AddressVerificationService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAddressVerificationService"
contract="AddressVerificationService.IAddressVerificationService"
name="BasicHttpBinding_IAddressVerificationService" />
<endpoint address="https://gis.customer.com/Geocoder/Service/GeocoderService.svc/ws"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IGeocoderService"
contract="GeocoderService.IGeocoderService" name="WSHttpBinding_IGeocoderService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="https://gis.customer.com/Geocoder/Service/GeocoderService.svc/soap"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IGeocoderService"
contract="GeocoderService.IGeocoderService" name="BasicHttpBinding_IGeocoderService" />
<endpoint address="http://hq-miler02.customer.net/MultiMiler/ALKWS/PCMiler.asmx"
binding="basicHttpBinding" bindingConfiguration="PCMilerSoap"
contract="PCMiler.PCMilerSoap" name="PCMilerSoap" />
</client>
There was a problem when the service was deployed to a server behind the load balancer. When I try to call the service from WCFStorm or WebServiceStudio I get the message "The provided URI scheme 'https' is invalid; expected 'http'.
The endpoints for the service itself look right to me. However in the development and testing versions of the config, the client section uses http instead of http, while on the production servers it uses the load balancer's https address.
This seems like it should be obvious, but we're missing it. Can anybody give us a clue?
We have wcf services set up behind Windows Network Load Balancing without any issue (well there was one, but it wasn't to do with NLB).
I think it's to do with the address. The web server is usually unaware that it's behind a load balancer. all it sees are requests coming from one source, the load balancer. Your binding has it listening for https, but unless the load balancer talks to the web server over https, which is rare, the requests are coming over http, hence the error.
You need to either change the address to http, or set the load balancer to talk to the web server via http.
So I'm late to the party, but i ran into the same issue with calling a service behind F5. Change your client binding security to Transport instead of None.