Do you have something like the following in your web.config:
<system.serviceModel> <client> <endpoint name="ImageServiceClientEndPoint" address="net.tcp://serverxyz:8000/ImageService" binding="netTcpBinding" bindingConfiguration="ImageServiceBinding" contract="EPiServer.ImageLibrary.IImageService" /> </client> <bindings> <netTcpBinding > <binding name="ImageServiceBinding" maxReceivedMessageSize="20000000"> <readerQuotas maxArrayLength="20000000" /> <security mode="None"> </security> </binding> </netTcpBinding > </bindings> </system.serviceModel>
Thanks for the reply. I added this endpoint configuration to web.config and now the System.InvalidOperationException is fixed.
However the imageService.RenderImage() method now returns a null.
byte newImageBuffer = imageService.RenderImage(imageBuffer, operations, imageMimeType, zoomFactor, 100);
This method correctly worked when using the ImageServiceClient("ImageServiceClientEndPoint") constructor before EPiServer upgrade. Am I missing something?
Do you also have the image service itself configured in <system.serviceModel>?
<services> <service name="EPiServer.ImageLibrary.ImageService"> <endpoint address="net.tcp://serverxyz:8000/ImageService" binding="netTcpBinding" bindingConfiguration="ImageServiceBinding" contract="EPiServer.ImageLibrary.IImageService" /> </service> </services>
No. Now I added ImageService configuration as well.
But the RenderImage() method still returns a null.
The setting ClientEndpoint property on ImageServiceOptions is to be used if you want to host the ImageService in another application/process as your web application, in that case you need to specify an endpoint in web.config as stated before. You can also (which is the default behavior) run the image service in-process then you just leave the ClientEndpoint property empty/null on then imageServiceOptions class.
I use EPiServer.ImageLibrary ImageServiceClient RenderImage method to render a cropped image. This was the code before upgrade to EPiServer CMS 11.5 and this was working fine.
After the upgrade, this code shows a compile error;
'ImageServiceClient.ImageServiceClient(string)' is obsolete: 'Use constructor that takes options instead, read options from container'
Accordingly, I changed the code as follows;
Then I was able to compile successfully. But now this throws this exception;
System.InvalidOperationException: 'Could not find endpoint element with name 'ImageServiceClientEndPoint' and contract 'EPiServer.ImageLibrary.IImageService' 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.'
What have I done wrong here?