Re: WCF Service upload file
this is the right way to go. You dont want external users having direct access to the database. By keeping it in a service, you can do some upfront validation in the client, file sizes, no malitious uploads etc.
Re: WCF Service upload file
Thanks bill,
Do you know of any links or keywords i can look for as i need to see some examples ?
anything ive tried to this point has failed (its been a while now since i tried this and im only coming back to it now)
Re: WCF Service upload file
IM in a world of hurt with this...
Any help at all is greatly appreciated
:mad:
Ive tried many different things ive seen on the web with this being the simplest i can see. Im thinking hes not giving me all of the information i need.
other issues i had with other solutions were parser errors saying behaviour dont exist...
http://scorpiotek.com/blog/?p=393
anyway - as it stands at the moment ive reverted to this 'simpler' solution
The appconfig of my client
Code:
<basicHttpBinding>
<binding name="BasicHttpBinding_IService1" 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="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
and the web config of my wcf is like so
Code:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="myBindingForBigArrays"
maxReceivedMessageSize="2147483647">
<readerQuotas
maxDepth="64"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="4096"
maxNameTableCharCount="16384"/>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
but my issue still remians :(
its like the image / file im sending is too big
Quote:
---------------------------
---------------------------
System.ServiceModel.ProtocolException: The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'fileUpload'. The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 25096.
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at ....ServiceReference1.IService1.fileUpload(Byte[] f, String fileName)
---------------------------
OK
---------------------------
Re: WCF Service upload file
and now im getting a bad request response with all my messing.
ive tried setting this in code and still it has no effect.
the wcf is hosted online on iis.
ive wiped the slate clean and created a new wcf service which has been uploade.
im calling a single operation with the same response.
anyone ....