DimxmlAsXDocument=MyXmlDimactual()AsByteDimproxyAs MyWebService.MyServiceClient=NothingTryproxy=New MyWebService.MyServiceClientactual=proxy.GenerateForm(xml.Root)proxy.Close()CatchexAsTimeoutExceptionproxy.Abort()Throwex'Or do what everCatchexAsCommunicationExceptionproxy.Abort()ThrowexCatchexAsExceptionproxy.Abort()ThrowexEndTry

I got the real error message which was that in the config binding maxBufferSize cannot be a different value from maxReceivedMessageSize.